incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject android commit: Fix for CB-389: resolveLocalFileSystemURI does not work on a resized image captured from Camera.getPicture()
Date Tue, 27 Mar 2012 01:35:43 GMT
Updated Branches:
  refs/heads/master 1e2c38598 -> dfc86b1af


Fix for CB-389: resolveLocalFileSystemURI does not work on a resized image captured from Camera.getPicture()


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/dfc86b1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/dfc86b1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/dfc86b1a

Branch: refs/heads/master
Commit: dfc86b1af14e197206ab1ab4782df2f068caec72
Parents: 1e2c385
Author: macdonst <simon.macdonald@gmail.com>
Authored: Mon Mar 26 21:35:34 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Mon Mar 26 21:35:34 2012 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileUtils.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/dfc86b1a/framework/src/org/apache/cordova/FileUtils.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java
index 297219d..9334543 100755
--- a/framework/src/org/apache/cordova/FileUtils.java
+++ b/framework/src/org/apache/cordova/FileUtils.java
@@ -254,7 +254,12 @@ public class FileUtils extends Plugin {
             URL testUrl = new URL(decoded);
 
             if (decoded.startsWith("file://")) {
-                fp = new File(decoded.substring(7, decoded.length()));
+                int questionMark = decoded.indexOf("?");
+                if (questionMark < 0) {
+                    fp = new File(decoded.substring(7, decoded.length()));
+                } else {
+                    fp = new File(decoded.substring(7, questionMark));
+                }
             } else {
                 fp = new File(decoded);
             }


Mime
View raw message