coil-kt / coil

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

Adding a NOOP decoder to Image Loader causes animated GIFs and WEBPs to be static #1720

Closed valeriyo closed 1 year ago

valeriyo commented 1 year ago

Describe the bug Adding a "no-op" decoder, which according to the documentation

image

should have no side-effects, causes animated GIFs and WEBPs to no longer be animated

To Reproduce

  1. To an ImageLoader builder, add .components { add(Decoder.Factory { _, _, _ -> Decoder { null } }) }
  2. Try to load an animated GIF or WEBP
  3. The image loads as a static image

Logs/Screenshots No errors are logged

Version 2.2.2

valeriyo commented 1 year ago

This is related to https://github.com/coil-kt/coil/issues/1695 -- because the workaround for that problem (providing a custom decoder) causes animated images to be static.

colinrtwhite commented 1 year ago

This is expected behaviour. Returning null from a Decoder delegates to the next decoder, which is likely BitmapFactoryDecoder which decodes animated images as static.

valeriyo commented 1 year ago

This is expected behaviour. Returning null from a Decoder delegates to the next decoder, which is likely BitmapFactoryDecoder which decodes animated images as static.

And why is "next" decoder not the one that understands how to decode animated GIF/WEBP ? This is not expected at all.