coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.81k stars 661 forks source link

Android Compose: GIFs not animating when they have no .gif extension #2497

Closed MaartenDEV closed 1 month ago

MaartenDEV commented 1 month ago

Describe the bug Loading GIFs in the AsyncImage only animates them when the URL ends with ".gif". When they don't, the first frame is displayed.

Version 2.7.0, Android with Jetpack Compose

colinrtwhite commented 1 month ago

Please provide code to reproduce this including a GIF that causes this issue. Coil's GIF decoder already has detection to check for GIF headers.

MaartenDEV commented 1 month ago

Terribly sorry, our server hosts GIFs without an extension, and I assumed that was the reason they weren't animating as other files with extensions did work. I now realise our server probably doesn't include the correct headers, as other GIFs I find online without an extension do work.

colinrtwhite commented 1 month ago

@MaartenDEV Sorry by GIF headers I meant a code at the start of the file that indicates the file is a GIF (according to the GIF spec). It should be baked into the file to make a valid GIF and we check for them here. Do you have an example GIF that Coil doesn't detect correctly?

MaartenDEV commented 1 month ago

@colinrtwhite As far as I know, Coil works great for GIFs. It turns out our image resizing service wasn't properly configured for GIFs, so the error was on our side, not on Coils.