Closed kmnaseef closed 6 months ago
I'm sorry, but I can't help you investigate the problem without any code. Can you share a reproducer? A branch with telephoto's sample app would be the best.
issue: ZoomableAsyncImage cannot display an image that can do with Coil AsyncImage.
what I did:
Note: NOT added implementation("io.coil-kt:coil-gif:2.5.0"). there is no difference if added. AsyncImage displaying even this not added
This is very interesting. thallu.gif
is a single-frame GIF. telephoto
is failing to display it because,
Your project isn't using Coil's GIF decoder. If you use GifDecoder
, the image will be shown correctly.
If you use ImageDecoderDecoder
, which coil suggests using on API 28+, Android will read the GIF as a bitmap instead of an animated drawable because there is no animation needed for a single frame. This is confusing for telephoto
because it tries to sub-sample this bitmap and fails when BitmapRegionDecoder
refuses to decode a GIF.
I'm thinking I'll have to solve this by manually checking if an image is a GIF here: https://github.com/saket/telephoto/blob/3bf32591a79caf6ce08f2c9cd00357776003066c/zoomable-image/coil/src/main/kotlin/me/saket/telephoto/zoomable/coil/subSamplingEligibility.kt#L22
Please do! I'll make a release soon, but you can use 0.11.0-SNAPSHOT
in the meantime.
Yea, Its Working.. Thank you.
Coil AsyncImage() can display this image, but ZoomableAsyncImage() cannot. please check. ImageDecoderDecoder.Factory() component added in both cases.