brendan-duncan / image

Dart Image Library for opening, manipulating, and saving various different image file formats.
MIT License
1.14k stars 255 forks source link

Crop results an empty image on version 4.2.0 #661

Open iquirino opened 2 weeks ago

iquirino commented 2 weeks ago

Hello guys, I've catch a new issue/bug with the new version 4.2.0.

I'm having issues to crop images. Using the following code results in an empty image. Rollback version to 4.1.7 solved the issue.

      final cmd = img.Command()
        ..decodeImage(await httpResponse.stream.toBytes())
        ..trim(mode: img.TrimMode.transparent);
      await cmd.executeCommand();
      final croppedImage = await cmd.getImage();

      if (croppedImage == null) {
        return HttpGetResponse(httpResponse);
      }

      final croppedImageBytes = img.encodePng(croppedImage);

Image used to crop:

https://front.epossible.com.br/public/assets/6682c14170fa73490e0bf0e4/logo.png

Thank you!

iquirino commented 1 week ago

I found a solution to this: https://github.com/brendan-duncan/image/pull/662