diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java index 9809ed11..1eb0b90f 100644 --- a/framework/src/org/apache/cordova/Capture.java +++ b/framework/src/org/apache/cordova/Capture.java @@ -148,9 +148,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 c7d02804..32d36784 100755 --- a/framework/src/org/apache/cordova/FileUtils.java +++ b/framework/src/org/apache/cordova/FileUtils.java @@ -740,7 +740,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); }