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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 17:53:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bc0164a01b38869db8bab1573e2575570d818eea
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 2 08:05:30 2010 +0000

    2010-12-02  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Gray-scale JPEG images with a color profile are stretched horizonally
            https://bugs.webkit.org/show_bug.cgi?id=49950
    
            Turns out gray-scale JPEGs with color profiles have the same issue as
            PNGs.  As with PNGs, we suppress now suppress the color profile for
            gray-scale JPEGs.  Most importantly, this patch adds a test.
    
            Test: fast/images/gray-scale-jpeg-with-color-profile.html
    
            * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
            (WebCore::JPEGImageReader::decode):
    2010-12-02  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Gray-scale JPEG images with a color profile are stretched horizonally
            https://bugs.webkit.org/show_bug.cgi?id=49950
    
            Test that we properly render gray-scale JPEGs with embedded color
            profiles.
    
            * fast/images/gray-scale-jpeg-with-color-profile.html: Added.
            * fast/images/resources/flowchart.jpg: Added.
            * platform/mac/fast/images/gray-scale-jpeg-with-color-profile-expected.txt: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8e265fd..73afc37 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-02  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Gray-scale JPEG images with a color profile are stretched horizonally
+        https://bugs.webkit.org/show_bug.cgi?id=49950
+
+        Test that we properly render gray-scale JPEGs with embedded color
+        profiles.
+
+        * fast/images/gray-scale-jpeg-with-color-profile.html: Added.
+        * fast/images/resources/flowchart.jpg: Added.
+        * platform/mac/fast/images/gray-scale-jpeg-with-color-profile-expected.txt: Added.
+
 2010-12-01  Daniel Bates  <dbates at rim.com>
 
         Remove file LayoutTests/platform/gtk/Skipped.rej which was
diff --git a/LayoutTests/fast/images/gray-scale-jpeg-with-color-profile.html b/LayoutTests/fast/images/gray-scale-jpeg-with-color-profile.html
new file mode 100644
index 0000000..5199218
--- /dev/null
+++ b/LayoutTests/fast/images/gray-scale-jpeg-with-color-profile.html
@@ -0,0 +1 @@
+<img src="resources/flowchart.jpg">
diff --git a/LayoutTests/fast/images/resources/flowchart.jpg b/LayoutTests/fast/images/resources/flowchart.jpg
new file mode 100644
index 0000000..7582ba6
Binary files /dev/null and b/LayoutTests/fast/images/resources/flowchart.jpg differ
diff --git a/LayoutTests/platform/mac/fast/images/gray-scale-jpeg-with-color-profile-expected.txt b/LayoutTests/platform/mac/fast/images/gray-scale-jpeg-with-color-profile-expected.txt
new file mode 100644
index 0000000..c8debb1
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/gray-scale-jpeg-with-color-profile-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 785x660
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x660
+  RenderBlock {HTML} at (0,0) size 785x660
+    RenderBody {BODY} at (8,8) size 769x644
+      RenderImage {IMG} at (0,0) size 500x644
+      RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9bddde5..5ddc688 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-02  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Gray-scale JPEG images with a color profile are stretched horizonally
+        https://bugs.webkit.org/show_bug.cgi?id=49950
+
+        Turns out gray-scale JPEGs with color profiles have the same issue as
+        PNGs.  As with PNGs, we suppress now suppress the color profile for
+        gray-scale JPEGs.  Most importantly, this patch adds a test.
+
+        Test: fast/images/gray-scale-jpeg-with-color-profile.html
+
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageReader::decode):
+
 2010-12-01  Geoffrey Garen  <ggaren at apple.com>
 
         Build fix: Added a forwarding header.
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 5a04bee..f209dda 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -316,6 +316,8 @@ namespace WebCore {
         // transparency.
         virtual bool supportsAlpha() const { return true; }
 
+        void setIgnoreGammaAndColorProfile(bool flag) { m_ignoreGammaAndColorProfile = flag; }
+
         // Whether or not the gamma and color profile are applied.
         bool ignoresGammaAndColorProfile() const { return m_ignoreGammaAndColorProfile; }
 
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index ff1262e..a2b9f8e 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -208,8 +208,13 @@ public:
             // Let libjpeg take care of gray->RGB and YCbCr->RGB conversions.
             switch (m_info.jpeg_color_space) {
             case JCS_GRAYSCALE:
-            case JCS_RGB:
             case JCS_YCbCr:
+                // Grayscale images get "upsampled" by libjpeg.  If we use
+                // their color profile, CoreGraphics will "upsample" them
+                // again, resulting in horizontal distortions.
+                m_decoder->setIgnoreGammaAndColorProfile(true);
+                // Note fall-through!
+            case JCS_RGB:
                 m_info.out_color_space = JCS_RGB;
                 break;
             case JCS_CMYK:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list