mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-03-16 05:51:02 +08:00
fix(ios): correctly append exif on iOS 14 (#685)
This commit is contained in:
parent
ebe0517a24
commit
2d1ee66a2b
@ -651,13 +651,15 @@ static NSString* toBase64(NSData* data) {
|
|||||||
CDVPluginResult* result = nil;
|
CDVPluginResult* result = nil;
|
||||||
|
|
||||||
if (self.metadata) {
|
if (self.metadata) {
|
||||||
CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)self.data, NULL);
|
NSData* dataCopy = [self.data mutableCopy];
|
||||||
|
CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)dataCopy, NULL);
|
||||||
CFStringRef sourceType = CGImageSourceGetType(sourceImage);
|
CFStringRef sourceType = CGImageSourceGetType(sourceImage);
|
||||||
|
|
||||||
CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
|
CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
|
||||||
CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
|
CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
|
||||||
CGImageDestinationFinalize(destinationImage);
|
CGImageDestinationFinalize(destinationImage);
|
||||||
|
|
||||||
|
dataCopy = nil;
|
||||||
CFRelease(sourceImage);
|
CFRelease(sourceImage);
|
||||||
CFRelease(destinationImage);
|
CFRelease(destinationImage);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user