Merge pull request #548 from DavidBertet/task/fix_png_ios_simulator

Fix #517. iOS simulator pictures are PNG instead of JPEG
This commit is contained in:
Seph Soliman 2023-06-11 17:53:23 -07:00 committed by GitHub
commit 815730ed94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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