Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not load gif image from url with backgroundDecode. #2145

Open
marcobui92 opened this issue Sep 23, 2023 · 2 comments
Open

Can not load gif image from url with backgroundDecode. #2145

marcobui92 opened this issue Sep 23, 2023 · 2 comments

Comments

@marcobui92
Copy link

I can not load gif image from url when using backgroundDecode.
It's just displayed with static image, not animated image.
If i removed option backgroundDecode, it's oke but make a lagging for many gif images on the screen.
How can i fix it?
Thanks in advance.

@FaisalShabbir007
Copy link

If you're experiencing issues with loading animated GIF images from URLs when using the backgroundDecode option in Kingfisher, there are a few potential solutions you can try:

Increase Memory Limit: The backgroundDecode option allows images to be decoded in the background, which can improve performance but may consume more memory. If you're experiencing issues with animated GIFs not loading properly, try increasing the memory limit for Kingfisher by setting the cacheMemoryCost property of the ImageCache.default instance to a higher value. This can help ensure that enough memory is available for decoding animated GIFs.

ImageCache.default.memoryStorage.config.totalCostLimit = 100 * 1024 * 1024 // 100 MB

Limit Concurrent Downloads: Kingfisher allows you to limit the number of concurrent image downloads using the maximumConcurrentDownloads property of the ImageDownloader.default instance. By reducing the number of concurrent downloads, you can prevent excessive memory usage and improve performance, especially when loading multiple GIF images simultaneously.

ImageDownloader.default.maxConcurrentDownloads = 4 // Limit to 4 concurrent downloads

Check Image Formats as well

@nyb112
Copy link

nyb112 commented Apr 11, 2024

@FaisalShabbir007 Not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants