forked from github/cordova-android
CB-2292: Added a check for width and height. You can't scale nothing because you can't divide by zero.
This commit is contained in:
@@ -571,7 +571,13 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||||
options.inJustDecodeBounds = true;
|
options.inJustDecodeBounds = true;
|
||||||
BitmapFactory.decodeFile(imagePath, options);
|
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
|
// determine the correct aspect ratio
|
||||||
int[] widthHeight = calculateAspectRatio(options.outWidth, options.outHeight);
|
int[] widthHeight = calculateAspectRatio(options.outWidth, options.outHeight);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user