Android blank bitmap

203 Views Asked by At

I'm creating bitmaps using inSampleSize. I've come across an unusual problem. On some images the rescaled image is blank.

Example 1:

Original: 4288x2848 inSampleSize = 2; Rescale: 2144x1424

Result is a blank image

Original: 4288x2848 inSampleSize = 4; Rescale: 1072x712

Result is a proper image

Example 2:

Original: 4752x3168 inSampleSize = 4; Rescale: 1188x792

Result is a proper image

This one fails at inSampleSize = 2 also.

Now none of the failures throw the obvious OOM error. However, it certainly seems as I approach 3MB image sizes the BitmapFactory.decodeFile(..) is silently failing to create the image.

I can tighten the memory constraint, but I'd really like to know what is causing this artifact; appreciate any insight. Thanks!

0

There are 0 best solutions below