image_pixels
image_pixels copied to clipboard
imageProvider ignores dimensions of ResizeImage
Hi :)
First of all, thanks for the amazing package ❤
I cannot find information about this anywhere -- I'm getting unexpected results for the following code:
final originalImage = AssetImage(silhouette['path']); // w100 h200
final image = ResizeImage(
originalImage,
height: 100, // set the height to 100
);
return ImagePixels(
imageProvider: image,
builder: (context, img) {
if (!img.hasImage) {
return SizedBox();
}
print('${img.width}'); // 100
print('${img.height}'); // 200
Is there a way to make ResizeImage work with ImagePixels?
Hey Ivan. It's getting the size from the original image. I'd have to change it a lot to make it work with ResizeImage. I'll leave this issue open to work on this in the future, but it's not going to be soon. Meanwhile, since you know the image's height was changed to 100, you should do the calculations yourself, to find out the real width and height.