2011-02-04 Hironori Bono <hbono@chromium.org>
[WebKit.git] / Source / WebCore / platform / image-decoders / jpeg / JPEGImageDecoder.cpp
index e88ff1d2193b56a1999d16bf3f502f1cd140c3c6..1434c65d2ab2785ecf4bbbf6e5e4789bece8a9b1 100644 (file)
@@ -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();