React-native-image-crop-picker: Cancel at cropper cause error

Created on 21 Apr 2019  路  2Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.23.1
  • react-native v0.59

Platform

  • iOS

Expected behaviour

openPicker with Cropper -> select image -> cancel at cropper -> select another image -> confirm at copper -> an image should be returned.

Actual behaviour

openPicker with Cropper -> select image -> cancel at cropper -> select another image -> confirm at copper -> no image is returned.

Turn on debug mode show:
The callback openPicker() exists in module ImageCropPicker; but only one callback my be registered to a function in a native module.

Steps to reproduce

  1. openPicker with Cropper, select image , cancel at cropper

  2. select another image

  3. confirm at copper

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective:
馃憠 https://opencollective.com/react-native-image-crop-picker/donate

Most helpful comment

Possible Fix ?

ImageCropPicker.m

  • (void)imageCropViewControllerDidCancelCrop:
    (RSKImageCropViewController *)controller {
    [self dismissCropper:controller selectionDone:NO completion:[self waitAnimationEnd:^{
    if (_self.currentSelectionMode != PICKER &&_ (self.currentSelectionMode == CROPPING || [[self.options objectForKey:@"cropping"] boolValue])) {
    self.reject(ERROR_PICKER_CANCEL_KEY, ERROR_PICKER_CANCEL_MSG, nil);
    }
    }]];
    }

All 2 comments

Possible Fix ?

ImageCropPicker.m

  • (void)imageCropViewControllerDidCancelCrop:
    (RSKImageCropViewController *)controller {
    [self dismissCropper:controller selectionDone:NO completion:[self waitAnimationEnd:^{
    if (_self.currentSelectionMode != PICKER &&_ (self.currentSelectionMode == CROPPING || [[self.options objectForKey:@"cropping"] boolValue])) {
    self.reject(ERROR_PICKER_CANCEL_KEY, ERROR_PICKER_CANCEL_MSG, nil);
    }
    }]];
    }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

habovh picture habovh  路  3Comments

leelandclay picture leelandclay  路  3Comments

equesteo picture equesteo  路  3Comments

JodiWarren picture JodiWarren  路  3Comments

xuchao321 picture xuchao321  路  3Comments