Kingfisher icon indicating copy to clipboard operation
Kingfisher copied to clipboard

Can not load gif image from url with backgroundDecode.

Open marcobui92 opened this issue 1 year ago • 2 comments

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.

marcobui92 avatar Sep 23 '23 05:09 marcobui92

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

FaisalShabbir007 avatar Mar 27 '24 18:03 FaisalShabbir007

@FaisalShabbir007 Not working

nyb112 avatar Apr 11 '24 08:04 nyb112