|
|
|
@ -175,6 +175,7 @@ public class CameraUtils { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Bitmap bitmap; |
|
|
|
|
try { |
|
|
|
|
if (maxWidth < Integer.MAX_VALUE || maxHeight < Integer.MAX_VALUE) { |
|
|
|
|
BitmapFactory.Options options = new BitmapFactory.Options(); |
|
|
|
|
options.inJustDecodeBounds = true; |
|
|
|
@ -202,6 +203,11 @@ public class CameraUtils { |
|
|
|
|
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); |
|
|
|
|
temp.recycle(); |
|
|
|
|
} |
|
|
|
|
} catch (OutOfMemoryError e) { |
|
|
|
|
// Create blank bitmap if out of memory to avoid crash
|
|
|
|
|
int dummySize = 100; |
|
|
|
|
bitmap = Bitmap.createBitmap(dummySize, dummySize, Bitmap.Config.ARGB_8888); // this creates a MUTABLE bitmap
|
|
|
|
|
} |
|
|
|
|
return bitmap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|