Fix certain JPEG files are failed to be decoded with BitmapRegionDecoder#219
Fix certain JPEG files are failed to be decoded with BitmapRegionDecoder#219amliu wants to merge 1 commit intojdamcd:masterfrom
Conversation
amliu
commented
Apr 11, 2016
- this is a known issue of Google : https://code.google.com/p/android/issues/detail?id=77195
- this should fix issue java.io.IOException: Image failed to decode using JPEG decoder #177
- this is a known issue of Google : https://code.google.com/p/android/issues/detail?id=77195
|
Tested on certain files and it worked! Thanks! |
|
@ivanviragine glad to know that! thanks for your response |
|
Unfortunately, this isn't working. Some pictures are getting "y + height must be <= bitmap.height()" exception. I will dig in to understand the problem, but sounds like it's a width and height rounding problem... |
|
Here's what I've got so far: original photo: 4128 x 2322 crop should be (squared example): 2322 x 2322 so, the rectangle should be left = 903 (that is imageWidth-cropWidth / 2), right = 3225 (that is left+cropWidth), top = 0, bottom = 2322 (that is cropHeight) Ok? The code is generating these values instead: left = 900 (-3 of actual value), right = 3224 (-1 of actual value), top = 0, bottom = 2324 (+2 of actual value) But, somehow,
finds its way, even with these wrong parameters (like 2324 as height instead of the actual 2322 height), but
doesn't. |
|
@ivanviragine May you provide your tested picture in this case so I can reproduce the issue and take a deeper look. Thanks. |