[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 15:32:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 61f31199cc50eb0e13a4f87b91a4a6e2149ccaba
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 6 01:01:18 2010 +0000

    2010-11-05  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Gray-scale PNGs with color profiles don't decode properly on Chromium Mac
            https://bugs.webkit.org/show_bug.cgi?id=49110
    
            Test that we decode gray-scale PNGs correctly.  Sadly, this is a pixel
            test.  For ports that run pixel tests, we'll have to grab the pixels
            off the bot.
    
            * fast/images/gray-scale-png-with-color-profile.html: Added.
            * fast/images/resources/mu.png: Added.
            * platform/mac/fast/images/gray-scale-png-with-color-profile-expected.txt: Added.
    2010-11-05  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Gray-scale PNGs with color profiles don't decode properly on Chromium Mac
            https://bugs.webkit.org/show_bug.cgi?id=49110
    
            Applying the color profile from this PNG was causing the image to
            triple in width.  This seems to be because both the PNG decoder and
            CoreGraphics were trying to expand the gray-scale image to RGB.  To fix
            this issue, I've disabled color profile support for gray-scale PNGs.
    
            Test: fast/images/gray-scale-png-with-color-profile.html
    
            * platform/image-decoders/png/PNGImageDecoder.cpp:
            (WebCore::PNGImageDecoder::headerAvailable):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8353fa4..5e3cdcc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-11-05  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Gray-scale PNGs with color profiles don't decode properly on Chromium Mac
+        https://bugs.webkit.org/show_bug.cgi?id=49110
+
+        Test that we decode gray-scale PNGs correctly.  Sadly, this is a pixel
+        test.  For ports that run pixel tests, we'll have to grab the pixels
+        off the bot.
+
+        * fast/images/gray-scale-png-with-color-profile.html: Added.
+        * fast/images/resources/mu.png: Added.
+        * platform/mac/fast/images/gray-scale-png-with-color-profile-expected.txt: Added.
+
 2010-11-05  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/fast/images/gray-scale-png-with-color-profile.html b/LayoutTests/fast/images/gray-scale-png-with-color-profile.html
new file mode 100644
index 0000000..ac6b0b5
--- /dev/null
+++ b/LayoutTests/fast/images/gray-scale-png-with-color-profile.html
@@ -0,0 +1 @@
+<img src="resources/mu.png">
diff --git a/LayoutTests/fast/images/resources/mu.png b/LayoutTests/fast/images/resources/mu.png
new file mode 100644
index 0000000..e0a7ce2
Binary files /dev/null and b/LayoutTests/fast/images/resources/mu.png differ
diff --git a/LayoutTests/platform/mac/fast/images/gray-scale-png-with-color-profile-expected.txt b/LayoutTests/platform/mac/fast/images/gray-scale-png-with-color-profile-expected.txt
new file mode 100644
index 0000000..281ac7c
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/gray-scale-png-with-color-profile-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderImage {IMG} at (0,0) size 383x321
+      RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 00c1501..4690bdf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-05  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Gray-scale PNGs with color profiles don't decode properly on Chromium Mac
+        https://bugs.webkit.org/show_bug.cgi?id=49110
+
+        Applying the color profile from this PNG was causing the image to
+        triple in width.  This seems to be because both the PNG decoder and
+        CoreGraphics were trying to expand the gray-scale image to RGB.  To fix
+        this issue, I've disabled color profile support for gray-scale PNGs.
+
+        Test: fast/images/gray-scale-png-with-color-profile.html
+
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageDecoder::headerAvailable):
+
 2010-11-05  Jian Li  <jianli at chromium.org>
 
         Reviewed by Dmitry Titov.
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 5e7e6da..e4f7a0c 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -265,7 +265,15 @@ void PNGImageDecoder::headerAvailable()
     int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
     png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);
 
-    m_colorProfile = readColorProfile(png, info);
+    if (colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_RGB_ALPHA) {
+        // We currently support color profiles only for RGB and RGBA PNGs.  Supporting
+        // color profiles for gray-scale images is slightly tricky, at least using the
+        // CoreGraphics ICC library, because we expand gray-scale images to RGB but we
+        // don't similarly transform the color profile.  We'd either need to transform
+        // the color profile or we'd need to decode into a gray-scale image buffer and
+        // hand that to CoreGraphics.
+        m_colorProfile = readColorProfile(png, info);
+    }
 
     // The options we set here match what Mozilla does.
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list