You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CachedNetworkImage has memCacheWidth/memCacheHeight to reduce image memory, I think it implement by ResizeImage when look CachedNetworkImage src. But it's not work in gif, how to solve it?
@darshankawar Yes. I mean, I use the CachedNetworkImage memCacheWidth to reduce the memory usage of very large images. This method is effective for many image formats, such as webp and png, but it is not valid for gif. I see that CachedNetworkImage memCacheWidth is actually call ResizeImage resizeIfNeeded, so I want to ask if the problem lies in ResizeImage
@weiminghuaa
What platform are you trying this on ? Is it possible to provide a self contained code only using ReSizeImage with a sample gif, that we can directly use to verify this ?
@darshankawar I have tested memory only using ReSizeImage with a sample gif. You can test the following code, no matter which way, the memory usage is 36.5M
@weiminghuaa
If we consider above code snippet, since it uses core components and not 3rd party plugin, I see that above, you have provided only cacheWidth and kept cacheHeight as null.
Looking at the documentation, it states Composes the provider in a ResizeImage only when cacheWidth and cacheHeight are not both null.. So can you try by providing both parameters and see if it helps ?
@weiminghuaa
How are you measuring the memory ?
Can you compare it with a sample image (png or jpeg, basically non-gif image) and see if it resizes and reflects in the memory you are measuring ?
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
weiminghuaa commentedon Sep 27, 2021
#24835
darshankawar commentedon Sep 28, 2021
@weiminghuaa
Are you referring / using https://pub.dev/packages/cached_network_image/install plugin ?
weiminghuaa commentedon Sep 28, 2021
@darshankawar Yes. I mean, I use the CachedNetworkImage memCacheWidth to reduce the memory usage of very large images. This method is effective for many image formats, such as webp and png, but it is not valid for gif. I see that CachedNetworkImage memCacheWidth is actually call ResizeImage resizeIfNeeded, so I want to ask if the problem lies in ResizeImage
darshankawar commentedon Sep 28, 2021
@weiminghuaa
What platform are you trying this on ? Is it possible to provide a self contained code only using
ReSizeImagewith a sample gif, that we can directly use to verify this ?weiminghuaa commentedon Sep 28, 2021
@darshankawar I have tested memory only using ReSizeImage with a sample gif. You can test the following code, no matter which way, the memory usage is 36.5M
darshankawar commentedon Sep 29, 2021
@weiminghuaa
If we consider above code snippet, since it uses core components and not 3rd party plugin, I see that above, you have provided only
cacheWidthand keptcacheHeightasnull.Looking at the documentation, it states
Composes the provider in a ResizeImage only when cacheWidth and cacheHeight are not both null.. So can you try by providing both parameters and see if it helps ?https://api.flutter.dev/flutter/painting/ResizeImage/resizeIfNeeded.html
weiminghuaa commentedon Sep 30, 2021
I have try by providing both width and height, it's not work.
darshankawar commentedon Sep 30, 2021
@weiminghuaa
How are you measuring the memory ?
Can you compare it with a sample image (png or jpeg, basically non-gif image) and see if it resizes and reflects in the memory you are measuring ?
6 remaining items
snailflying commentedon Aug 14, 2024
Oh,it is since 2021,Now is 2024! Is there any progress?
feat(images): skip memCacheWidth/Height for GIF URLs - Flutter has a …
[engine] Honor targetWidth/targetHeight for animated images (flutter#…
mohamedalsamrai commentedon Oct 27, 2026
Finally Done
[engine] Honor targetWidth/targetHeight for animated images (flutter#…
github-actions commentedon Nov 10, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.