1

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!

Anthony
  • 7,638
  • 3
  • 38
  • 71
  • The issue is is that the Dalvik Memory Manager is denying your request for memory. If you look at your logs, you will see how much its requesting. Throw some logs into that using the System class and you'll find out how much is available. – JoxTraex Aug 02 '12 at 21:03

0 Answers0