prevent the creation of picture bigger than original for android

This commit is contained in:
Fares Hantous 2016-10-08 21:49:38 +01:00
parent 569b069a03
commit 67755254fc

View File

@ -1076,8 +1076,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
* @return
*/
public int[] calculateAspectRatio(int origWidth, int origHeight) {
int newWidth = this.targetWidth;
int newHeight = this.targetHeight;
int newWidth = Math.min(this.targetWidth, origWidth);
int newHeight = Math.min(this.targetHeight, origHeight);
// If no new width or height were specified return the original bitmap
if (newWidth <= 0 && newHeight <= 0) {