incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From becka...@apache.org
Subject ios commit: Fix CB-427 add back iOS only getPicture options
Date Thu, 05 Apr 2012 14:45:46 GMT
Updated Branches:
  refs/heads/master 23b3a2270 -> 0089d98c6


Fix CB-427 add back iOS only getPicture options

added back support for allowEdit, correctOrientation, saveToPhotoAlbum


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/0089d98c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/0089d98c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/0089d98c

Branch: refs/heads/master
Commit: 0089d98c695098ab743c214a7d127ad46f716f22
Parents: 23b3a22
Author: Becky Gibson <becka11y@apache.org>
Authored: Wed Apr 4 10:53:13 2012 -0400
Committer: Becky Gibson <becka11y@apache.org>
Committed: Thu Apr 5 09:42:16 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCamera.m |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/0089d98c/CordovaLib/Classes/CDVCamera.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCamera.m b/CordovaLib/Classes/CDVCamera.m
index 2d48f0e..a079b40 100644
--- a/CordovaLib/Classes/CDVCamera.m
+++ b/CordovaLib/Classes/CDVCamera.m
@@ -31,7 +31,20 @@
 	return ( NSClassFromString(@"UIPopoverController") != nil) && 
 	(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
 }
-
+/*  takePicture arguments:
+ * INDEX   ARGUMENT
+ *  0       callbackId
+ *  1       quality
+ *  2       destination type
+ *  3       source type
+ *  4       targetWidth
+ *  5       targetHeight
+ *  6       encodingType
+ *  7       mediaType
+ *  8       allowsEdit
+ *  9       correctOrientation
+ *  10      saveToPhotoAlbum
+ */
 - (void) takePicture:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
 {
 	NSString* callbackId = [arguments objectAtIndex:0];
@@ -50,11 +63,10 @@
         [self writeJavascript:[result toErrorCallbackString:callbackId]];
         
 	} else {
-        // TODO: re-enable this?
-        // bool allowEdit = [[options valueForKey:@"allowEdit"] boolValue];
+        bool allowEdit = [[arguments objectAtIndex:8] boolValue];
         NSNumber* targetWidth = [arguments objectAtIndex:4];
         NSNumber* targetHeight = [arguments objectAtIndex:5];
-        NSNumber* mediaValue = [options valueForKey:@"mediaType"];
+        NSNumber* mediaValue = [arguments objectAtIndex:7];
         CDVMediaType mediaType = (mediaValue) ? [mediaValue intValue] : MediaTypePicture;
         
         CGSize targetSize = CGSizeMake(0, 0);
@@ -70,12 +82,11 @@
         
         self.pickerController.delegate = self;
         self.pickerController.sourceType = sourceType;
-        //self.pickerController.allowsEditing = allowEdit; // THIS IS ALL IT TAKES FOR CROPPING
- jm
+        self.pickerController.allowsEditing = allowEdit; // THIS IS ALL IT TAKES FOR CROPPING
- jm
         self.pickerController.callbackId = callbackId;
         self.pickerController.targetSize = targetSize;
-        // TODO: wtf?
-        self.pickerController.correctOrientation = [[options valueForKey:@"correctOrientation"]
boolValue];
-        self.pickerController.saveToPhotoAlbum = [[options valueForKey:@"saveToPhotoAlbum"]
boolValue];
+        self.pickerController.correctOrientation = [[arguments objectAtIndex:9] boolValue];
+        self.pickerController.saveToPhotoAlbum = [[arguments objectAtIndex:10] boolValue];
         
         self.pickerController.encodingType = ([arguments objectAtIndex:6]) ? [[arguments
objectAtIndex:6] intValue] : EncodingTypeJPEG;
         


Mime
View raw message