onevcat / Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.
MIT License
23.41k stars 2.66k forks source link

Setting animated image to UIImageView is laggy #1905

Open ealymbaev opened 2 years ago

ealymbaev commented 2 years ago

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

What

I am trying to achieve smooth displaying (and playing) animated images (GIF) in table view.

I have tried the following options:

  1. AnimatedImageView: if image view is small - loads and plays GIF without any issues. But if image view is quite large (has screen width) - it uses too much CPU so my table view scroll speed is ugly. (NOT AN OPTION)

  2. UIImageView with backgroundDecode: loads an image without any issues, BUT does not play GIF (just shows first frame) (NOT AN OPTION)

  3. UIImageView without backgroundDecode: loads an image without any issues, BUT it has a UI lag immediately before displaying loaded GIF. There are no any other issues with this option.

Is there any fixes for this short lag in option 3?

Reproduce

The gif image that was used during testing this issue is:

https://lh3.googleusercontent.com/-xPp5V0RpKS9VoXE5vusG3xUzQjR-TZ0swiQiibWT3buny6t_FB2qf_O0p-1qV-M3jF0ImXDTDgWNdPawONzPShsfiStUcWLp821sRo

Other Comment

[Add anything else here]

ealymbaev commented 2 years ago

Any thoughts on this issue? I can provide any details if required. I can also provide screen video recording of this lag if needed.

japanese-goblinn commented 1 year ago

Any updates on this one? I'm facing the same problem with low frame rate for gif