diff --git a/ios/src/ImageCropPicker.m b/ios/src/ImageCropPicker.m index 1739bb0..c4270f7 100644 --- a/ios/src/ImageCropPicker.m +++ b/ios/src/ImageCropPicker.m @@ -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 { @@ -284,11 +283,11 @@ RCT_EXPORT_METHOD(openPicker:(NSDictionary *)options @"SyncedFaces" : @(PHAssetCollectionSubtypeAlbumSyncedFaces), @"SyncedAlbum" : @(PHAssetCollectionSubtypeAlbumSyncedAlbum), @"Imported" : @(PHAssetCollectionSubtypeAlbumImported), - + //cloud albums @"PhotoStream" : @(PHAssetCollectionSubtypeAlbumMyPhotoStream), @"CloudShared" : @(PHAssetCollectionSubtypeAlbumCloudShared), - + //smart albums @"Generic" : @(PHAssetCollectionSubtypeSmartAlbumGeneric), @"Panoramas" : @(PHAssetCollectionSubtypeSmartAlbumPanoramas), @@ -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:^{