Skip to content

Commit 0bdb98a

Browse files
Merge pull request guillermomuntaner#70 from bithug/master
Allow editing captured images
2 parents 699de98 + 92efb1b commit 0bdb98a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

GMImagePicker/GMImagePickerController.h

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ static CGSize const kPopoverContentSize = {480, 720};
121121
*/
122122
@property (nonatomic, assign) BOOL autoSelectCameraImages;
123123

124+
/**
125+
* If set, the user is allowed to edit captured still images
126+
*/
127+
@property (nonatomic, assign) BOOL allowsEditingCameraImages;
128+
124129
/**
125130
* Grid customizations:
126131
*

GMImagePicker/GMImagePickerController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ - (void)cameraButtonPressed:(UIBarButtonItem *)button
286286
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
287287
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
288288
picker.mediaTypes = @[(NSString *)kUTTypeImage];
289-
picker.allowsEditing = NO;
289+
picker.allowsEditing = self.allowsEditingCameraImages;
290290
picker.delegate = self;
291291
picker.modalPresentationStyle = UIModalPresentationPopover;
292292

@@ -353,7 +353,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
353353

354354
NSString *mediaType = info[UIImagePickerControllerMediaType];
355355
if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
356-
UIImage *image = info[UIImagePickerControllerOriginalImage];
356+
UIImage *image = info[UIImagePickerControllerEditedImage] ? : info[UIImagePickerControllerOriginalImage];
357357
UIImageWriteToSavedPhotosAlbum(image,
358358
self,
359359
@selector(image:finishedSavingWithError:contextInfo:),

0 commit comments

Comments
 (0)