diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 20:10:16 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 20:10:16 +0000 |
commit | 223eec790690b3b72913f7a5c5574cd5768f5ecc (patch) | |
tree | f0eccca3f51ce8ac4e6e1aa0605587db66a88e4c /src/gvcore | |
parent | 1e52d17fecd0e1cc17a5db4083a5c4ff4fd608b9 (diff) | |
download | gwenview-223eec790690b3b72913f7a5c5574cd5768f5ecc.tar.gz gwenview-223eec790690b3b72913f7a5c5574cd5768f5ecc.zip |
Fix gwenview libpng>1.4.x FTBFS
This closes Bug #337
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1239916 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gvcore')
-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++; |