Changeset 53305 in webkit


Ignore:
Timestamp:
Jan 14, 2010 5:30:04 PM (14 years ago)
Author:
pkasting@chromium.org
Message:

Decoding images to scaled output buffers resulted in garbage for
no-alpha PNGs and CMYK JPEGs.
https://bugs.webkit.org/show_bug.cgi?id=33624

Reviewed by Adam Barth.

No layout test since I don't have access to a platform that scales the
output buffers.

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:

(WebCore::convertCMYKToRGBA):

  • platform/image-decoders/png/PNGImageDecoder.cpp:

(WebCore::PNGImageDecoder::rowAvailable):

Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53301 r53305  
     12010-01-14  Peter Kasting  <pkasting@google.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Decoding images to scaled output buffers resulted in garbage for
     6        no-alpha PNGs and CMYK JPEGs.
     7        https://bugs.webkit.org/show_bug.cgi?id=33624
     8       
     9        No layout test since I don't have access to a platform that scales the
     10        output buffers.
     11
     12        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
     13        (WebCore::convertCMYKToRGBA):
     14        * platform/image-decoders/png/PNGImageDecoder.cpp:
     15        (WebCore::PNGImageDecoder::rowAvailable):
     16
    1172010-01-14  Brian Weinstein  <bweinstein@apple.com>
    218
  • trunk/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

    r52791 r53305  
    471471        int numColumns = scaledColumns.size();
    472472        for (int x = 0; x < numColumns; ++x) {
    473             JSAMPLE* jsample = src + scaledColumns[x] * 3;
     473            JSAMPLE* jsample = src + scaledColumns[x] * 4;
    474474            unsigned c = jsample[0];
    475475            unsigned m = jsample[1];
  • trunk/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp

    r52880 r53305  
    405405        bool sawAlpha = buffer.hasAlpha();
    406406        for (int x = 0; x < columns; ++x) {
    407             png_bytep pixel = row + m_scaledColumns[x] * 4;
    408             unsigned alpha = pixel[3];
     407            png_bytep pixel = row + m_scaledColumns[x] * colorChannels;
     408            unsigned alpha = (hasAlpha ? pixel[3] : 255);
    409409            buffer.setRGBA(x, destY, pixel[0], pixel[1], pixel[2], alpha);
    410410            if (!sawAlpha && alpha < 255) {
Note: See TracChangeset for help on using the changeset viewer.