[CB-3757] camera.getPicture from photolib fails on iOS

-set data pointer properly when there's no controller metadata
This commit is contained in:
James Jong 2013-06-17 17:48:15 -04:00
parent a23de52370
commit a9b79ebb44

View File

@ -307,10 +307,11 @@ static NSSet* org_apache_cordova_validArrowDirections;
if (cameraPicker.encodingType == EncodingTypePNG) { if (cameraPicker.encodingType == EncodingTypePNG) {
data = UIImagePNGRepresentation(scaledImage == nil ? image : scaledImage); data = UIImagePNGRepresentation(scaledImage == nil ? image : scaledImage);
} else { } 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"]; NSDictionary *controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
if (controllerMetadata) { if (controllerMetadata) {
self.data = data;
self.metadata = [[NSMutableDictionary alloc] init]; self.metadata = [[NSMutableDictionary alloc] init];
NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy]; NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];