File tree 1 file changed +3
-1
lines changed
SDWebImageWebPCoder/Classes
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -888,11 +888,13 @@ - (nullable NSData *)sd_encodedWebpDataWithImage:(nullable CGImageRef)imageRef
888
888
if (!colorSpace) {
889
889
colorSpace = [SDImageCoderHelper colorSpaceGetDeviceRGB ];
890
890
}
891
+ CGColorRenderingIntent renderingIntent = CGImageGetRenderingIntent (imageRef);
891
892
vImage_CGImageFormat destFormat = {
892
893
.bitsPerComponent = 8 ,
893
894
.bitsPerPixel = hasAlpha ? 32 : 24 ,
894
895
.colorSpace = colorSpace,
895
- .bitmapInfo = hasAlpha ? kCGImageAlphaLast | kCGBitmapByteOrderDefault : kCGImageAlphaNone | kCGBitmapByteOrderDefault // RGB888/RGBA8888 (Non-premultiplied to works for libwebp)
896
+ .bitmapInfo = hasAlpha ? kCGImageAlphaLast | kCGBitmapByteOrderDefault : kCGImageAlphaNone | kCGBitmapByteOrderDefault , // RGB888/RGBA8888 (Non-premultiplied to works for libwebp)
897
+ .renderingIntent = renderingIntent
896
898
};
897
899
vImage_Buffer dest;
898
900
// We could not assume that input CGImage's color mode is always RGB888/RGBA8888. Convert all other cases to target color mode using vImage
You can’t perform that action at this time.
0 commit comments