hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
1k stars 392 forks source link

IOSUiSettings.aspectRatioLockDimensionSwapEnabled doesn't seem to automatically rotate the crop area #501

Open DanielSeldura opened 5 months ago

DanielSeldura commented 5 months ago

I upgraded from 2.0.x to 7 as I was updating the app to the latest flutter and found the IOSUiSettings.aspectRatioLockDimensionSwapEnabled doesn't seem to enable the old functionality as shown below

https://github.com/hnvn/flutter_image_cropper/assets/16881329/c68548da-7b3a-40cc-83d4-6507fcbfbc55

And now it just does this

image after a 90 deg rotate image This is the configuration I used

CroppedFile? croppedFile = await ImageCropper().cropImage(
      sourcePath: image.path,
      aspectRatio: CropAspectRatio(ratioX: 1.417, ratioY: 1),
      compressFormat: ImageCompressFormat.png,
      uiSettings: [
        AndroidUiSettings(
          toolbarTitle: 'Crop image',
          toolbarColor: ColorConsts.main,
          lockAspectRatio: true,
        ),
        IOSUiSettings(
          title: 'Crop image',
          aspectRatioLockEnabled: true,
          aspectRatioLockDimensionSwapEnabled: true,
          aspectRatioPickerButtonHidden: false,
        ),
      ],
    );
SergioMordente commented 3 months ago

Hi, I noticed you mentioned that after upgrading from 2.0.x to 7, the IOSUiSettings.aspectRatioLockDimensionSwapEnabled doesn't seem to enable the old functionality in the image_cropper package. I am facing the same problem on version 8.0.0, 8.01 and 8.0.2 for IOS. Were you able to find a solution or alternative to this? Any help would be greatly appreciated!

DanielSeldura commented 2 months ago

Sorry, nothing from the author. I suspect this goes deeper as the dependency is a collation of several cropping implementations and the problem is actually the author of the ios implementation's changes.