[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