Bug 86722

Summary: Add a test for PNG COLOR_TYPE_PALETTE image with a color profile
Product: WebKit Reporter: noel gordon <noel.gordon>
Component: Tools / TestsAssignee: noel gordon <noel.gordon>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, bweinstein, eric, newt, rakuco, tpayne, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.libpng.org/pub/png/png-colortest.html
Bug Depends on:    
Bug Blocks: 101551    
Attachments:
Description Flags
Screen shot: Safari-5.1.5-left and Chrome-20.0.1132.3-dev-right
none
png-colortest-html-images-webkit-test-use.txt
none
Patch
none
paletted-color-gamma-one-color-profile-image-info
none
test image in chrome 21, safari 5.1.7, firefox 12
none
Patch none

Description noel gordon 2012-05-17 05:43:39 PDT
Some test images at the above URL are PNG_COLOR_TYPE_PALETTE color and have an ICC color profile.  The public image decoders that support ICC color profiles (currently, Chromium MAC) decode the images fine but fail to properly color correct the decoded image.

Add a test for this case, then fix it later by adding PNG_COLOR_TYPE_PALETTE color correction support to the public PNG decoder.
Comment 2 noel gordon 2012-05-17 22:32:54 PDT
Reference image (what they should look it):
  http://www.libpng.org/pub/png/img_png/ArcTriomphe-iCCP-orig.png
Comment 3 noel gordon 2012-05-17 22:33:52 PDT
Created attachment 142631 [details]
Screen shot: Safari-5.1.5-left and Chrome-20.0.1132.3-dev-right
Comment 4 noel gordon 2012-05-17 22:34:57 PDT
Safari gets it right, and so does Mozilla 3.6+
Comment 5 noel gordon 2012-05-18 01:52:09 PDT
The images on the URL page are Creative Commons Attribution-NonCommercial 2.5 License.
http://creativecommons.org/licenses/by-nc/2.5

I wrote to the page owner asking for permission to use the images.  Reply attached.
Comment 6 noel gordon 2012-05-18 01:54:11 PDT
Created attachment 142664 [details]
png-colortest-html-images-webkit-test-use.txt
Comment 7 noel gordon 2012-05-18 02:15:48 PDT
+brian per comment #5 #6, ok to use of these images in your view?
Comment 8 Greg Roelofs 2012-05-18 11:38:02 PDT
I took the photo and created the images from scratch. Consider them licensed under CC-SA or an equivalent "use as you wish but share any modifications/derivations under the same terms" license.

And if that doesn't cut it, let me know.
Comment 9 noel gordon 2012-05-22 20:51:50 PDT
Thank you Greg.  WebKit is BSD licensed http://trac.webkit.org/browser/trunk/Source/WebKit/LICENSE and Brian would know if what you've said "cuts it" for us.  I'll prepare a layout test patch, awaiting word on ok to use.
Comment 10 noel gordon 2012-05-23 00:14:17 PDT
Created attachment 143482 [details]
Patch
Comment 11 Adam Barth 2012-05-23 10:55:16 PDT
Comment on attachment 143482 [details]
Patch

LGTM, assuming you're happy with the licensing terms.
Comment 12 noel gordon 2012-06-05 23:10:02 PDT
Created attachment 145939 [details]
paletted-color-gamma-one-color-profile-image-info

Ah well, no answers: created a paletted PNG image in photoshop with a gamma-1.0 RGB color profile for this test.  Image and profile details in the attachment.
Comment 13 noel gordon 2012-06-05 23:13:49 PDT
Created attachment 145940 [details]
test image in chrome 21, safari 5.1.7, firefox 12 

Chrome clearly does not color correct this image.
Comment 14 noel gordon 2012-06-05 23:15:27 PDT
Created attachment 145941 [details]
Patch
Comment 15 WebKit Review Bot 2012-06-06 19:33:10 PDT
Comment on attachment 145941 [details]
Patch

Clearing flags on attachment: 145941

Committed r119664: <http://trac.webkit.org/changeset/119664>
Comment 16 WebKit Review Bot 2012-06-06 19:33:16 PDT
All reviewed patches have been landed.  Closing bug.