You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/01/25 23:41:38 UTC

[1/2] android commit: CB-2292: Added a check for width and height. You can't scale nothing because you can't divide by zero.

CB-2292: Added a check for width and height. You can't scale nothing because you can't divide by zero.


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

Branch: refs/heads/master
Commit: 6ced2ff293f89773cfa1c7facda29ad931b0dc5e
Parents: d9b15cf
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Jan 25 14:41:14 2013 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri Jan 25 14:41:14 2013 -0800

----------------------------------------------------------------------
 .../src/org/apache/cordova/CameraLauncher.java     |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/6ced2ff2/framework/src/org/apache/cordova/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java
index f9edd10..3012ee3 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -571,7 +571,13 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
         BitmapFactory.Options options = new BitmapFactory.Options();
         options.inJustDecodeBounds = true;
         BitmapFactory.decodeFile(imagePath, options);
-
+        
+        //CB-2292: WTF? Why is the width null?
+        if(options.outWidth == 0 || options.outHeight == 0)
+        {
+            return null;
+        }
+        
         // determine the correct aspect ratio
         int[] widthHeight = calculateAspectRatio(options.outWidth, options.outHeight);