Permalink
Browse files

added optional param to camera.getPicture to allow editing : options:…

…{allowEdit:true}

The user will see a crop dialog after chosing the image, this is a good way to restrict huge files from the library.
  • Loading branch information...
1 parent 282bad5 commit 3bb7a2ed9723b32a25b90c4a33c570cd66da004a Jesse MacFadyen committed Jun 1, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 PhoneGapLib/Classes/Camera.m
View
3 PhoneGapLib/Classes/Camera.m
@@ -37,13 +37,16 @@ - (void) getPicture:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)op
NSLog(@"Camera.getPicture: source type %d not available.", sourceType);
return;
}
+
+ bool allowEdit = [[options valueForKey:@"allowEdit"] boolValue];
if (pickerController == nil) {
pickerController = [[CameraPicker alloc] init];
}
pickerController.delegate = self;
pickerController.sourceType = sourceType;
+ pickerController.allowsEditing = allowEdit; // THIS IS ALL IT TAKES FOR CROPPING - jm
pickerController.successCallback = successCallback;
pickerController.errorCallback = errorCallback;
pickerController.quality = [options integerValueForKey:@"quality" defaultValue:100 withRange:NSMakeRange(0, 100)];

0 comments on commit 3bb7a2e

Please sign in to comment.