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

Crop view freezes on iOS until the background image is loaded completely. #538

Open
ZahraVe opened this issue Sep 30, 2022 · 0 comments
Open
Assignees
Labels

Comments

@ZahraVe
Copy link

ZahraVe commented Sep 30, 2022

Describe the bug
I am using high-resolution images, which are pretty large in size, in my app. Images are shown in the photo-view (PhotoViewGallery.builder). Each image takes a few sec to be loaded
If you try to pop the copper view before the image is completely loaded on screen:
On Android, you don't see the image in cropper view, and the checkmark is indicating circular progress until the image is ready. -> which is UX-friendly!
But on iOS, You immediately see the image in cropper view but the screen freezes, like a glitch, you need to hold on until the image is loaded. -> This is a bad experience for the user.

Here is the function that I use for saving wallpaper and it pops up the cropper:

Future<bool> saveWallpaperPortion(String myPath) async {
    var file = await DefaultCacheManager().getSingleFile(myPath);
    final croppedFile = await ImageCropper().cropImage(
      sourcePath: file.path,
      aspectRatio: CropAspectRatio(
          ratioY: SizeConfig.screenHeight, ratioX: SizeConfig.screenWidth),
      compressQuality: 100,
      uiSettings: [
        IOSUiSettings(
          rotateButtonsHidden: true,
          rotateClockwiseButtonHidden: true,
          aspectRatioLockEnabled: true,
        ),
      ],
    );
    try {
      if (croppedFile != null) {
        try {
          final result = await ImageGallerySaver.saveFile(croppedFile.path);
          return true;
        } catch (e) {
          return false;
        }
      } else {
        return false;
      }
    } catch (e) {
      return false;
    }
  }

Expected behavior
Getting the same behaviour as Android on iOS

Screenshots
If applicable, add screenshots to help explain your problem.

iOS Device:
iPhone 12 pro, iPhone 13pro, iPhone 14 pro

Additional context
How to work around this issue! I am about to release the app!

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

No branches or pull requests

2 participants