[chromium] PNG image with CMYK ICC color profile renders color-inverted and squashed
authornoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 09:56:46 +0000 (09:56 +0000)
committernoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 09:56:46 +0000 (09:56 +0000)
commitfd5de1059ce510b756dbcbc26fd31e818d44dea2
tree4038a83fcbbe6c3748099152427549b216292875
parent5df03415c2af382af253ba27c4ffe220935f24ae
[chromium] PNG image with CMYK ICC color profile renders color-inverted and squashed
https://bugs.webkit.org/show_bug.cgi?id=76804

Reviewed by Adam Barth.

Source/WebCore:

Use color profiles for PNG images only if their embedded color profile is from an RGB
color space input device.

Test: fast/images/rgb-png-with-cmyk-color-profile.html

* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::rgbColorProfile): Return true if the profile has an RGB color space.
(WebCore::ImageDecoder::inputDeviceColorProfile): Return true if the profile is from an input device.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::readColorProfile): Ignore PNG image embedded color profile unless the profile
comes from an RGB color space input device.
(WebCore::PNGImageDecoder::headerAvailable): Minor white-space removals courtesy Xcode.

LayoutTests:

* fast/images/resources/rgb-png-with-cmyk-color-profile.png: Added.
* fast/images/rgb-png-with-cmyk-color-profile-expected.txt: Added.
* fast/images/rgb-png-with-cmyk-color-profile.html: Added.
* platform/mac/fast/images/rgb-png-with-cmyk-color-profile-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/images/resources/rgb-png-with-cmyk-color-profile.png [new file with mode: 0644]
LayoutTests/fast/images/rgb-png-with-cmyk-color-profile-expected.txt [new file with mode: 0644]
LayoutTests/fast/images/rgb-png-with-cmyk-color-profile.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/images/rgb-png-with-cmyk-color-profile-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/image-decoders/ImageDecoder.h
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp