Description
Environment
Android
Description
I'm experiencing an issue when trying to scale a large image down to a lot smaller size. No cropping involved, although I don't think that matter.
If I'm not misunderstanding how things work, the code related to sample size in cropAndResizeTask
is incorrect. outOptions.inSampleSize
is calculated and set, and then the parameters to Bitmap.createBitmap
are modified based on the resulting value, but the bitmap is never decoded, from which the new resulting is created from, is never decoded using the options
object and specifically the inSampleSize
. Therefore, if getDecodeSampleSize
returns a sampleSize greater than 1, the parameters to Bitmap.createBitmap
is downscaled, which results in a undesired "cropping" of the resulting bitmap
Reproducible Demo
Try to scale down (no cropping) an image to such an target size that the getDecodeSampleSize
method returns a value greater than 1.