~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to khtml/imload/decoders/pngloader.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    
51
51
    bool        interlaced;
52
52
    
53
 
    unsigned int width;
54
 
    unsigned int height;
 
53
    png_uint_32  width;
 
54
    png_uint_32  height;
55
55
    unsigned int depth;
56
56
    
57
57
    unsigned char* scanlineBuf; //Used only for interlaced images
82
82
    {
83
83
        int bitDepth, colorType, interlaceType;
84
84
    
85
 
        png_get_IHDR(pngReadStruct, pngInfoStruct, (png_uint_32*)&width, (png_uint_32*)&height, &bitDepth, 
 
85
        png_get_IHDR(pngReadStruct, pngInfoStruct, &width, &height, &bitDepth,
86
86
                     &colorType, &interlaceType, 0, 0);
87
87
        
88
88
        //Ask libPNG to change bit depths we don't support
144
144
        if (imFrm.type == ImageFormat::Image_RGB_32)
145
145
        {
146
146
            //Need fillers, plus perhaps BGR swapping for non-alpha
147
 
#ifdef WORDS_BIGENDIAN
 
147
#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
148
148
            png_set_filler(pngReadStruct, 0xff, PNG_FILLER_BEFORE);
149
149
#else
150
150
            png_set_filler(pngReadStruct, 0xff, PNG_FILLER_AFTER);
153
153
        }
154
154
        else if (imFrm.type == ImageFormat::Image_RGBA_32)
155
155
        {
156
 
#ifdef WORDS_BIGENDIAN
 
156
#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
157
157
            png_set_swap_alpha(pngReadStruct); //ARGB, not RGBA
158
158
#else
159
159
            png_set_bgr   (pngReadStruct);     //BGRA