Changeset 2945 for libpipi/trunk


Ignore:
Timestamp:
Oct 13, 2008, 11:17:27 PM (12 years ago)
Author:
Sam Hocevar
Message:

libpipi: do not swap bytes in the GDI loader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/codec/gdi.c

    r2909 r2945  
    6969    }
    7070
    71     /* FIXME: get rid of this loop, maybe by using BITMAPV4HEADER above
    72      * so that GDI reorders the pixels for us. */
    73     for(y = 0; y < img->h; y++)
    74         for(x = 0; x < img->w; x++)
    75         {
    76             /* Swap B and R, don't touch G and A. */
    77             uint8_t tmp = data[0]; data[0] = data[2]; data[2] = tmp;
    78             data += 4;
    79         }
     71    /* FIXME: do we need to swap bytes? Apparently Vista doesn't need it,
     72     * but we'd need a more thorough test. */
    8073
    8174    img->codec_priv = NULL;
     
    134127        {
    135128            uint8_t tmp[3];
    136             tmp[0] = data[4 * (img->w * (img->h - 1 - y) + x) + 2];
     129            tmp[0] = data[4 * (img->w * (img->h - 1 - y) + x) + 0];
    137130            tmp[1] = data[4 * (img->w * (img->h - 1 - y) + x) + 1];
    138             tmp[2] = data[4 * (img->w * (img->h - 1 - y) + x) + 0];
     131            tmp[2] = data[4 * (img->w * (img->h - 1 - y) + x) + 2];
    139132            WriteFile(hfile, tmp, 3, &ret, NULL);
    140133        }
Note: See TracChangeset for help on using the changeset viewer.