diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java index 98bc6d4f..1653d354 100644 --- a/framework/src/org/apache/cordova/Capture.java +++ b/framework/src/org/apache/cordova/Capture.java @@ -156,9 +156,10 @@ public class Capture extends Plugin { * @throws JSONException */ private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException { - Bitmap bitmap = BitmapFactory.decodeFile(filePath); + Bitmap bitmap = BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath)); obj.put("height", bitmap.getHeight()); obj.put("width", bitmap.getWidth()); + bitmap.recycle(); return obj; } diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java index dc219488..9b4eda67 100755 --- a/framework/src/org/apache/cordova/FileUtils.java +++ b/framework/src/org/apache/cordova/FileUtils.java @@ -743,7 +743,7 @@ public class FileUtils extends Plugin { * @param filePath to be checked. * @return */ - private String stripFileProtocol(String filePath) { + public static String stripFileProtocol(String filePath) { if (filePath.startsWith("file://")) { filePath = filePath.substring(7); }