mirror of
https://github.com/status-im/react-native-image-crop-picker.git
synced 2025-02-23 02:48:12 +00:00
Fix orientations (#682)
This commit is contained in:
parent
8395f734c3
commit
fe1423d124
@ -185,14 +185,13 @@ RCT_EXPORT_METHOD(openCamera:(NSDictionary *)options
|
||||
|
||||
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
|
||||
UIImage *chosenImage = [info objectForKey:UIImagePickerControllerOriginalImage];
|
||||
UIImage *chosenImageT = [chosenImage fixOrientation];
|
||||
|
||||
NSDictionary *exif;
|
||||
if([[self.options objectForKey:@"includeExif"] boolValue]) {
|
||||
exif = [info objectForKey:UIImagePickerControllerMediaMetadata];
|
||||
}
|
||||
|
||||
[self processSingleImagePick:chosenImageT withExif:exif withViewController:picker withSourceURL:self.croppingFile[@"sourceURL"] withLocalIdentifier:self.croppingFile[@"localIdentifier"] withFilename:self.croppingFile[@"filename"] withCreationDate:self.croppingFile[@"creationDate"] withModificationDate:self.croppingFile[@"modificationDate"]];
|
||||
[self processSingleImagePick:chosenImage withExif:exif withViewController:picker withSourceURL:self.croppingFile[@"sourceURL"] withLocalIdentifier:self.croppingFile[@"localIdentifier"] withFilename:self.croppingFile[@"filename"] withCreationDate:self.croppingFile[@"creationDate"] withModificationDate:self.croppingFile[@"modificationDate"]];
|
||||
}
|
||||
|
||||
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
|
||||
@ -349,7 +348,7 @@ RCT_EXPORT_METHOD(openCropper:(NSDictionary *)options
|
||||
if (error) {
|
||||
self.reject(ERROR_CROPPER_IMAGE_NOT_FOUND_KEY, ERROR_CROPPER_IMAGE_NOT_FOUND_MSG, nil);
|
||||
} else {
|
||||
[self startCropping:image];
|
||||
[self startCropping:[image fixOrientation]];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@ -706,9 +705,9 @@ RCT_EXPORT_METHOD(openCropper:(NSDictionary *)options
|
||||
self.croppingFile[@"modifcationDate"] = modificationDate;
|
||||
NSLog(@"CroppingFile %@", self.croppingFile);
|
||||
|
||||
[self startCropping:image];
|
||||
[self startCropping:[image fixOrientation]];
|
||||
} else {
|
||||
ImageResult *imageResult = [self.compression compressImage:image withOptions:self.options];
|
||||
ImageResult *imageResult = [self.compression compressImage:[image fixOrientation] withOptions:self.options];
|
||||
NSString *filePath = [self persistFile:imageResult.data];
|
||||
if (filePath == nil) {
|
||||
[viewController dismissViewControllerAnimated:YES completion:[self waitAnimationEnd:^{
|
||||
|
Loading…
x
Reference in New Issue
Block a user