mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:35:10 +08:00
[CB-3757] camera.getPicture from photolib fails on iOS
-set data pointer properly when there's no controller metadata
This commit is contained in:
parent
a23de52370
commit
a9b79ebb44
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user