File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
SDWebImageWebPCoder/Classes Expand file tree Collapse file tree 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
888888 if (!colorSpace) {
889889 colorSpace = [SDImageCoderHelper colorSpaceGetDeviceRGB ];
890890 }
891+ CGColorRenderingIntent renderingIntent = CGImageGetRenderingIntent (imageRef);
891892 vImage_CGImageFormat destFormat = {
892893 .bitsPerComponent = 8 ,
893894 .bitsPerPixel = hasAlpha ? 32 : 24 ,
894895 .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
896898 };
897899 vImage_Buffer dest;
898900 // 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