You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue details / Repro steps / Use case background:
I am trying to use CENTER_OUTSIDE DownsampleStrategy, which is default, in combination with ImageView's scaleType set to center. When the source width and height are greater than ImageView's, result image is downscaled correctly, but when the source width and height are smaller, the result values are not as expected. For example, when trying to load 3000x5000 image into 500x500 ImageView i get 833x500 downscaled image, but when loading 200x200 image into the same view i get 429x429 image as a result (expected 500x500 image in that case). My guess is that these values come from adjustTargetDensityForError method which can produce maxInt value in the case of upscaling and the resulting scale value becomes roughly 2.147.
My question is whether this behavior is correct or not?
Glide load line / GlideModule (if any) / list Adapter code (if any):
I check result bitmap size using listener's resource mBitmapWidth and mBitmapHeight
Thanks for filling out the issue template and providing an awesome level of detail. You're exactly right, there's a bug in that method that causes us to use 2.147 as the multiplier whenever we're using a DownsampleStrategy that upscales with an image that's smaller than the requested dimensions.
I've got a fix for it internally and will hopefully get it synced out today.
Glide Version: 4.2.0
Device/Android Version: Nexus 5 API 23
Issue details / Repro steps / Use case background:
I am trying to use CENTER_OUTSIDE DownsampleStrategy, which is default, in combination with ImageView's scaleType set to center. When the source width and height are greater than ImageView's, result image is downscaled correctly, but when the source width and height are smaller, the result values are not as expected. For example, when trying to load 3000x5000 image into 500x500 ImageView i get 833x500 downscaled image, but when loading 200x200 image into the same view i get 429x429 image as a result (expected 500x500 image in that case). My guess is that these values come from adjustTargetDensityForError method which can produce maxInt value in the case of upscaling and the resulting scale value becomes roughly 2.147.
My question is whether this behavior is correct or not?
Glide load line /
GlideModule
(if any) / list Adapter code (if any):I check result bitmap size using listener's resource mBitmapWidth and mBitmapHeight
Simple activity with layout and hardcoded ImageView size in px for testing purposes.
Layout XML:
The text was updated successfully, but these errors were encountered: