Bitmap can't load a 2MB image
This is the code I'm using:
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap imatgeOriginal = BitmapFactory.decodeFile(imageUrl, options);
Bitmap resizedbitmap = Bitmap.createScaledBitmap(imatgeOriginal, 1000,
1000, true);
As you can see I resize the image with the Options, but anyways it just
crashes on the last line, throwing a NullPointerException. So
imatgeOriginal is null
Do you guys have any tip? Why is this happening?
The image is 2MB and the size is: 1105 × 1491
This code works perfectly with any other smaller image.
No comments:
Post a Comment