Skip to content
Permalink
Browse files
fix(ios): correctly append exif on iOS 14 (#685)
  • Loading branch information
jcesarmobile committed Oct 28, 2020
1 parent ebe0517 commit 2d1ee66a2b6459540967d578cc534dc893546e12
Showing 1 changed file with 3 additions and 1 deletion.
@@ -651,13 +651,15 @@ - (void)imagePickerControllerReturnImageResult
CDVPluginResult* result = nil;

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);

CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
CGImageDestinationFinalize(destinationImage);

dataCopy = nil;
CFRelease(sourceImage);
CFRelease(destinationImage);
}

0 comments on commit 2d1ee66

Please sign in to comment.