How to get final image dimensions when using intrinsic size? #2167
Unanswered
fcastagnozzi-ta
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to know my AsyncImage's size in order to load the correct image url. My solution has been to use an Interceptor to get the size from the chain, and then update the model with the appropriate url. That works in most cases but doesn't work if my image uses intrinsic height. The ConstraintsSizeResolver.measure gets hit twice, once with undefined height and then a second time with the correct height, but coil uses only the first measurement to load the image. I suspect I could hack it by copying ConstraintSizeResolver and changing the implementation to wait for constraints that are bounded in both directions, but maybe I'm missing something cleaner that's already built in.
Beta Was this translation helpful? Give feedback.
All reactions