From b39b2fa3d56e5c66ace73bd866aaeb7472dfaa6c Mon Sep 17 00:00:00 2001 From: David Bertet Date: Mon, 5 Jun 2023 21:22:57 -0700 Subject: [PATCH] Fix #517. iOS sim pictures are PNG instead of JPEG --- ios/ReactNativeCameraKit/CKCamera.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/ReactNativeCameraKit/CKCamera.m b/ios/ReactNativeCameraKit/CKCamera.m index 87d12ec..2a2f15a 100644 --- a/ios/ReactNativeCameraKit/CKCamera.m +++ b/ios/ReactNativeCameraKit/CKCamera.m @@ -597,7 +597,7 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{ if (self.mockPreview != nil) { UIImage *previewSnapshot = [self.mockPreview snapshotWithTimestamp:YES]; // Generate snapshot from main UI thread dispatch_async( self.sessionQueue, ^{ // write image async - [self writeCapturedImageData:UIImagePNGRepresentation(previewSnapshot) onSuccess:onSuccess onError:onError]; + [self writeCapturedImageData:UIImageJPEGRepresentation(previewSnapshot, 0.85) onSuccess:onSuccess onError:onError]; }); } else { onError(@"Simulator image could not be captured from preview layer");