Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAD2BCE5E for ; Tue, 5 Jun 2012 12:46:10 +0000 (UTC) Received: (qmail 61412 invoked by uid 500); 5 Jun 2012 12:46:10 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 61382 invoked by uid 500); 5 Jun 2012 12:46:10 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 61368 invoked by uid 99); 5 Jun 2012 12:46:10 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 12:46:10 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E199EFEF4; Tue, 5 Jun 2012 12:46:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: macdonst@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: android commit: CB-860: MediaFile.getFormatData broken for Image from Capture Message-Id: <20120605124609.E199EFEF4@tyr.zones.apache.org> Date: Tue, 5 Jun 2012 12:46:09 +0000 (UTC) Updated Branches: refs/heads/master 24e5c24dd -> adfdb16dc CB-860: MediaFile.getFormatData broken for Image from Capture 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/adfdb16d Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/adfdb16d Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/adfdb16d Branch: refs/heads/master Commit: adfdb16dc5a726ac83d30b6b9daf61ab7c1129df Parents: 24e5c24 Author: macdonst Authored: Tue Jun 5 08:42:17 2012 -0400 Committer: macdonst Committed: Tue Jun 5 08:45:33 2012 -0400 ---------------------------------------------------------------------- framework/src/org/apache/cordova/Capture.java | 3 ++- framework/src/org/apache/cordova/FileUtils.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/adfdb16d/framework/src/org/apache/cordova/Capture.java ---------------------------------------------------------------------- diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java index 9809ed1..1eb0b90 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; } http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/adfdb16d/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 c7d0280..32d3678 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); }