Using memCacheWidth/height along with imageBuilder has no effect.
🐛 Bug Report
When adding a memCacheWidth or memCacheHeight, the cached version of the image doesn't get passed to the imageBuilder, so the image stays its original size.
When using debugInvertOversizedImages = true; the image is clearly still too large for its container. Removing the imageBuilder fixes this error.
Expected behavior
Image rendered through the imageBuilder should be lower resolution or smaller size.
Reproduction steps
Run the following with an image:
CachedNetworkImage(
imageUrl: imageUrl.toString(),
memCacheWidth: 50,
imageBuilder: (context, imageProvider) {
return Container(
width: double.infinity,
height: 150,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
);
},
),
Configuration
As above.
Version: 3.2.0
Platform:
- [ ] :iphone: iOS
- [X] :robot: Android
🐛 Bug Report
When adding a
memCacheWidthormemCacheHeight, the cached version of the image doesn't get passed to theimageBuilder, so the image stays its original size.When using
debugInvertOversizedImages = true;the image is clearly still too large for its container. Removing theimageBuilderfixes this error.Expected behavior
Image rendered through the imageBuilder should be lower resolution or smaller size.
Reproduction steps
Run the following with an image:
CachedNetworkImage( imageUrl: imageUrl.toString(), memCacheWidth: 50, imageBuilder: (context, imageProvider) { return Container( width: double.infinity, height: 150, decoration: BoxDecoration( image: DecorationImage( image: imageProvider, fit: BoxFit.cover, ), ), ); }, ),Configuration
As above.
Version: 3.2.0
Platform:
- [ ] 📱 iOS
- [x] 🤖 Android
Hi bro ! You can try update version to cached_network_image: ^3.2.2
Yes, it's because the image provider we are receiving is not applying the ResizeImage. I believe the implementation of imageBuilder on this package needs to be refactored, to make sure that we will receive the image based on the CachedNetworkImage settings