react-native-image-crop-picker: openCamera freezes on photo preview screen after canceling crop

Looks like the new feature that allows you to stay in the camera after canceling a crop doesn’t work for openCamera

Version

  • react-native-image-crop-picker: v0.14.1
  • react-native v0.42.0

Platform

  • iOS

Expected behaviour

Clicking Cancel on the cropper should take you back to functioning photo preview screen.

Actual behaviour

The cropper closes properly, but the resulting photo preview screen is frozen.

Steps to reproduce

  1. Use openCamera with cropping: true

  2. Take Photo (Camera) -> Use Photo (Photo Preview) -> Cancel (Cropper)

  3. Delivered back to the Photo Preview screen but it is frozen

Attachments

// stacktrace or any other useful debug info

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 28 (4 by maintainers)

Most upvoted comments

@Jobeso I am not sure if thats the perfect solution so creating a PR wont be of much use. Here is the code for your reference. Change following in ImageCropPicker.m

- (void) dismissCropper:(RSKImageCropViewController*) controller dismissAll: (BOOL) dissmissAll completion:(void (^)())completion {
    //We've presented the cropper on top of the image picker as to not have a double modal animation.
    //Thus, we need to dismiss the image picker view controller to dismiss the whole stack.
    if (!self.cropOnly) {
        if (dissmissAll) {
            UIViewController *topViewController = controller.presentingViewController.presentingViewController;
            [topViewController dismissViewControllerAnimated:YES completion:completion];
        } else {
            **// FIX: On landing on camera from retake app freezes so closing camera for now**
            UIViewController *topViewController = controller.presentingViewController.presentingViewController;
            // UIViewController *topViewController = controller.presentingViewController;
            [topViewController dismissViewControllerAnimated:YES completion:completion];
        }
    } else {
        [controller dismissViewControllerAnimated:YES completion:completion];
    }
}

@ivpusic Thanks for fixing that, my app no longer freezes but it now quits the whole openCamera flow. Is this expected behavior? I think, ideally, after clicking cancel when cropping a photo, it should take you back to functioning photo preview screen.

Is this possible? Any pointers how it can be done?

@jinxac could you provide this version or create a PR?