diff options
Diffstat (limited to 'src/gvcore/pngformattype.cpp')
-rw-r--r-- | src/gvcore/pngformattype.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gvcore/pngformattype.cpp b/src/gvcore/pngformattype.cpp index d89032a..ac40d87 100644 --- a/src/gvcore/pngformattype.cpp +++ b/src/gvcore/pngformattype.cpp @@ -245,7 +245,11 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr ) image.setColor( i, tqRgba(c,c,c,0xff) ); } if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { - const int g = info_ptr->trans_values.gray; +#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) + const int g = info_ptr->trans_color.gray; +#else + const int g = info_ptr->trans_values.gray; +#endif if (g < ncols) { image.setAlphaBuffer(TRUE); image.setColor(g, image.color(g) & TQRGB_MASK); @@ -273,7 +277,11 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr ) info_ptr->palette[i].red, info_ptr->palette[i].green, info_ptr->palette[i].blue, - info_ptr->trans[i] +#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) + info_ptr->trans_alpha[i] +#else + info_ptr->trans[i] +#endif ) ); i++; |