hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
995 stars 391 forks source link

Crash on Flutter `3.3.10` and iOS `16.2` #394

Open thiagocarvalhodev opened 1 year ago

thiagocarvalhodev commented 1 year ago

Steps to reproduce:

  1. Try to crop an image with Flutter 3.3.10 on iOS 16.2 (simulator or real device)
  2. App will crash

Tested in the 3.3.8 and is working fine.

Package version: 3.0.1,

Thanks.

dreampowder commented 1 year ago

same here, tested on 3 different devices with ios 16.2 + and flutter 3.3.0

lanrehnics commented 1 year ago

Any solution for this ??

adlifaldiz commented 1 year ago

any solution for this ?

hnvn commented 1 year ago

I cannot reproduce this issue with example project, please check your project, it may conflicts with other plugins.

lanrehnics commented 1 year ago

I cannot reproduce this issue with example project, please check your project, it may conflicts with other plugins.

Like ??

lanrehnics commented 1 year ago

Are you using Image Picker ?? if yes, try to use File Picker.

final result = await FilePicker.platform.pickFiles(type: FileType.media);
   final file = File(result.files.single.path);
   final    croppedFile = await ImageCropper().cropImage(sourcePath: file.path, aspectRatioPresets: [
              CropAspectRatioPreset.square,
              CropAspectRatioPreset.ratio3x2,
              CropAspectRatioPreset.original,
              CropAspectRatioPreset.ratio4x3,
              CropAspectRatioPreset.ratio16x9
            ], uiSettings: [
              AndroidUiSettings(
                  toolbarTitle: 'Cropper',
                  toolbarColor: Colors.grey,
                  toolbarWidgetColor: Colors.white,
                  initAspectRatio: CropAspectRatioPreset.original,
                  lockAspectRatio: false),
              IOSUiSettings(
                title: 'Cropper',
                  )
            ]);
stact commented 11 months ago

Hi @thiagocarvalhodev did you tried pick a different image ratio?

I don't if it's related, but it's working with landscape or photo images, but not with Phone screenshots.

Example this one: the app crash - not really a crash because no logs and not error/warning displayed but the app is stuck, even hot reload not working, need to stop debug and relaunch debug

IMG_2282

FYI @hnvn