summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp')
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index a255c25..1434c65 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -222,6 +222,12 @@ public:
// jpeglib cannot convert these to rgb, but it can convert ycck
// to cmyk.
m_info.out_color_space = JCS_CMYK;
+
+ // Same as with grayscale images, we convert CMYK images to RGBA
+ // ones. When we keep the color profiles of these CMYK images,
+ // CoreGraphics will convert their colors again. So, we discard
+ // their color profiles to prevent color corruption.
+ m_decoder->setIgnoreGammaAndColorProfile(true);
break;
default:
return m_decoder->setFailed();
@@ -462,7 +468,7 @@ bool JPEGImageDecoder::outputScanlines()
buffer.setColorProfile(m_colorProfile);
// For JPEGs, the frame always fills the entire image.
- buffer.setRect(IntRect(IntPoint(), size()));
+ buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
}
jpeg_decompress_struct* info = m_reader->info();