Fixed issue with opaque thumbnails being given an alpha channel
Summary:Images cropped using the ImageEditor were always given an alpha channel, even if opaque. This causes them to be saved as PNGs instead of JPEGs (increasing memory and bridge traffic) and also causes unnecessary blending when they are drawn. Reviewed By: fkgozali Differential Revision: D2982682 fb-gh-sync-id: b65f361efd78e35f259836111b38d914bae49847 shipit-source-id: b65f361efd78e35f259836111b38d914bae49847
This commit is contained in:
parent
f99579adaa
commit
738337815d
|
@ -316,7 +316,8 @@ UIImage *__nullable RCTTransformImage(UIImage *image,
|
|||
return nil;
|
||||
}
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(destSize, NO, destScale);
|
||||
BOOL opaque = !RCTImageHasAlpha(image.CGImage);
|
||||
UIGraphicsBeginImageContextWithOptions(destSize, opaque, destScale);
|
||||
CGContextRef currentContext = UIGraphicsGetCurrentContext();
|
||||
CGContextConcatCTM(currentContext, transform);
|
||||
[image drawAtPoint:CGPointZero];
|
||||
|
|
Loading…
Reference in New Issue