From a9b79ebb445999530f06684aa34170d890b12d9a Mon Sep 17 00:00:00 2001 From: James Jong Date: Mon, 17 Jun 2013 17:48:15 -0400 Subject: [PATCH] [CB-3757] camera.getPicture from photolib fails on iOS -set data pointer properly when there's no controller metadata --- src/ios/CDVCamera.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 343d250..11662ed 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -307,10 +307,11 @@ static NSSet* org_apache_cordova_validArrowDirections; if (cameraPicker.encodingType == EncodingTypePNG) { data = UIImagePNGRepresentation(scaledImage == nil ? image : scaledImage); } else { - self.data = UIImageJPEGRepresentation(scaledImage == nil ? image : scaledImage, cameraPicker.quality / 100.0f); + data = UIImageJPEGRepresentation(scaledImage == nil ? image : scaledImage, cameraPicker.quality / 100.0f); NSDictionary *controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"]; if (controllerMetadata) { + self.data = data; self.metadata = [[NSMutableDictionary alloc] init]; NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];