Dynamically resize an image depending on it's parsed dimensions #2428
OxygenCobalt
started this conversation in
General
Replies: 1 comment
-
There's no way to intercept and resize an image loaded from a URL before it's disk cached, however |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use coil for image loading a bitmap and putting it on my app's widget. Since I must always be mindful of how big my bitmap is (ill break the size limit otherwise), I have to dynamically resize it to fit under android's expected limit.
I've run into an issue doing this: Since some of my images can be non-square, I can't simply resize down every image to a fuzzy estimate of the bitmap size limit, since the longer images will always take up more space and will probably breach the limit.
I need some way I can take the dimensions of an image as soon as they are parsed, and then re-map the dimensions the actual size they should be decoded as on the fly.
Is there any way to do this in coil save simply a
Transformation
? I'm hesitant to implement aTransformation
given that I would need to fully copy and resize the bitmap, which seems highly inefficient.Beta Was this translation helpful? Give feedback.
All reactions