fluttercandies / flutter_image_compress

flutter image compress
MIT License
632 stars 215 forks source link

[Bug report] By using the compressAndGetFile method with the parameter quality:100, the images lose quality. #280

Open rafaelbesoft opened 7 months ago

rafaelbesoft commented 7 months ago

Version

version in pub.dev

Platforms

dart, Android

Device Model

All Models tested

flutter info

[✓] Flutter (Channel stable, 3.16.5, on Ubuntu 22.04.3 LTS 6.1.0-1027-oem, locale pt_BR.UTF-8)
    • Flutter version 3.16.5 on channel stable at /home/besoft/src/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (2 weeks ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/besoft/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/besoft/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases
    • pkg-config version 0.29.2
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)

[✓] Android Studio (version 2022.2)
    • Android Studio at /home/besoft/android-studio
    • Flutter plugin version 74.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.84.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • Redmi Note 8 Pro (mobile) • w85t4tovxwz9a6aq • android-arm64  • Android 11 (API 30)
    • Linux (desktop)           • linux            • linux-x64      • Ubuntu 22.04.3 LTS 6.1.0-1027-oem
    • Chrome (web)              • chrome           • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

How to reproduce?

my code

var res = await FlutterImageCompress.compressAndGetFile( imageToupdate!, '$folderInAppDocDir' + 'rotacioned_' + '${basename(imageToupdate!)}', rotate: -90, quality: 100, );

When using it this way several times, a loss of image quality is noticeable.

Logs

No response

Example code (optional)

var res = await FlutterImageCompress.compressAndGetFile(
    imageToupdate!, '$folderInAppDocDir' + 'rotacioned_' + '${basename(imageToupdate!)}',
    rotate: -90,
    quality: 100,
  );

Contact

No response

rafaelbesoft commented 7 months ago

https://github.com/fluttercandies/flutter_image_compress/assets/155546423/b7203ddb-e306-4bbb-92b0-b8af147505d8