Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Compress do not respect aspect ratio #299

Open
delfme opened this issue Apr 14, 2024 · 0 comments
Open

[Bug report] Compress do not respect aspect ratio #299

delfme opened this issue Apr 14, 2024 · 0 comments

Comments

@delfme
Copy link

delfme commented Apr 14, 2024

Version

^2.2.0

Platforms

Android

Device Model

Xiaomi Mi lite 5g

flutter info

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.21.0-17.0.pre.3, on macOS 14.2.1 23C71 darwin-arm64, locale en-IT)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)

How to reproduce?

  1. Pickup a square image, in my case it is the one returned by PhotoManager
entity!
            .thumbnailDataWithOption(
          ThumbnailOption(
            size: const ThumbnailSize.square(350),
            quality: 65,
            format: ThumbnailFormat.jpeg
          ),
        )

Compress image by passing squareSize (ie. 100)

 await FlutterImageCompress.compressWithFile(
        file.path,
        quality: quality,
        minWidth: (squareSize != null) ? squareSize : width,
        minHeight: (squareSize != null) ? squareSize : null,

Result should be a 100X100px which shouldn't alter the PhotoManager thumb but it is a non-squared result.

Logs

No response

Example code (optional)

No response

Contact

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant