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 1704bc29a369e42928497664f45dfbc8681c827c..dba37f772bd3d69b20d69e0ab2d77a602d3ea3c7 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp |
@@ -650,11 +650,19 @@ public: |
qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size()); |
if (!inputProfile) |
return; |
+ |
// We currently only support color profiles for RGB profiled images. |
ASSERT(rgbData == qcms_profile_get_color_space(inputProfile)); |
- qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; |
+ |
+ if (qcms_profile_match(inputProfile, deviceProfile)) { |
+ qcms_profile_release(inputProfile); |
+ return; |
+ } |
+ |
// FIXME: Don't force perceptual intent if the image profile contains an intent. |
+ qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; |
m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL); |
+ |
qcms_profile_release(inputProfile); |
} |
#endif |