xclud / flutter_crop

Crop any widget/image in Android, iOS, Web and Desktop with fancy and customizable UI, in pure Dart code.
https://pub.dev/packages/crop
MIT License
256 stars 84 forks source link

Artifact (Overflow) #88

Open AtjonTV opened 1 year ago

AtjonTV commented 1 year ago

Hello! I am currently building an app where I need to display product images.

As the faded background does not fit our design, I used dimColor: Colors.white to remove it.

After doing so, I noticed that Crop renders width*1 pixels either at the top or the bottom of the widget. This is really noticable with dimColor set to white.

This mostly occures when the image does not have the same aspect ratio as the space in which the widget is rendered.

In the example image below, the source image is a Portrait (dimensions 2592*3840 pixels), and needs to be shown in space no bigger then 300x400.

Very visible example with dim color white: image

Same can be seen with default dim: image

Here is the code that created that widget: image

I have tried to understand how Crop works to fix it myself, but I couldnt find the cause.