timbru31 commented on a change in pull request #501: Fixed corrupted image on 
ios 13 when using camera
URL: 
https://github.com/apache/cordova-plugin-camera/pull/501#discussion_r324567932
 
 

 ##########
 File path: src/ios/CDVCamera.m
 ##########
 @@ -670,17 +670,21 @@ - (void)imagePickerControllerReturnImageResult
 {
     CDVPictureOptions* options = self.pickerController.pictureOptions;
     CDVPluginResult* result = nil;
+   
+    NSMutableData *dest_data = [NSMutableData data];
 
     if (self.metadata) {
         CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge 
CFDataRef)self.data, NULL);
         CFStringRef sourceType = CGImageSourceGetType(sourceImage);
 
-        CGImageDestinationRef destinationImage = 
CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, 
sourceType, 1, NULL);
+        CGImageDestinationRef destinationImage = 
CGImageDestinationCreateWithData((__bridge CFMutableDataRef)dest_data, 
sourceType, 1, NULL);
         CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, 
(__bridge CFDictionaryRef)self.metadata);
         CGImageDestinationFinalize(destinationImage);
 
         CFRelease(sourceImage);
         CFRelease(destinationImage);
+    } else{
 
 Review comment:
   missing space after `else`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to