mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-16 08:21:04 +08:00
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:
parent
d9b15cf69e
commit
6ced2ff293
@ -572,6 +572,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user