Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 2203903002: Color: Read embedded ICC profiles regardless of QCMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 63827d47422ff0c17e4a010c501df144a1e88704..23d6d5ad898a455500551e08753de75e0548756a 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -451,17 +451,17 @@ public:
m_decoder->setOrientation(readImageOrientation(info()));
-#if USE(QCMSLIB)
// Allow color management of the decoded RGBA pixels if possible.
if (!m_decoder->ignoresGammaAndColorProfile()) {
#if USE(ICCJPEG)
JOCTET* profile = nullptr;
unsigned profileLength = 0;
if (read_icc_profile(info(), &profile, &profileLength)) {
- decoder()->setColorProfileAndTransform(reinterpret_cast<char*>(profile), profileLength, colorSpaceHasAlpha(info()->out_color_space), false /* useSRGB */);
+ decoder()->setColorProfileAndComputeTransform(reinterpret_cast<char*>(profile), profileLength, colorSpaceHasAlpha(info()->out_color_space), false /* useSRGB */);
free(profile);
}
#endif // USE(ICCJPEG)
+#if USE(QCMSLIB)
if (decoder()->colorTransform()) {
overrideColorSpace = JCS_UNKNOWN;
#if defined(TURBO_JPEG_RGB_SWIZZLE)
@@ -470,8 +470,8 @@ public:
m_info.out_color_space = JCS_EXT_RGBA;
#endif // defined(TURBO_JPEG_RGB_SWIZZLE)
}
- }
#endif // USE(QCMSLIB)
+ }
if (overrideColorSpace == JCS_YCbCr) {
m_info.out_color_space = JCS_YCbCr;
m_info.raw_data_out = TRUE;
@@ -927,7 +927,7 @@ bool JPEGImageDecoder::outputScanlines()
ASSERT(info->output_width == static_cast<JDIMENSION>(m_decodedSize.width()));
ASSERT(info->output_height == static_cast<JDIMENSION>(m_decodedSize.height()));
- if (!buffer.setSize(info->output_width, info->output_height))
+ if (!buffer.setSizeAndColorProfile(info->output_width, info->output_height, colorProfile()))
return setFailed();
// The buffer is transparent outside the decoded area while the image is

Powered by Google App Engine
This is Rietveld 408576698