From e8b2fef1b92bce6cd7f81e974d66db12c69293b0 Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 7 Feb 2010 14:45:36 +0000 Subject: [PATCH] neutrino: fix png alpha channel with older libpng git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@292 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/pictureviewer/png.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/pictureviewer/png.cpp b/src/driver/pictureviewer/png.cpp index 9d352926d..a0c81e73a 100644 --- a/src/driver/pictureviewer/png.cpp +++ b/src/driver/pictureviewer/png.cpp @@ -80,9 +80,11 @@ int fh_png_load(const char *name,unsigned char **buffer,int* /*xp*/,int* /*yp*/) /* this test does not trigger for 8bit-paletted PNGs with newer libpng (1.2.40 at least), but the data delivered is with alpha channel anyway, so always strip alpha for now - if (color_type & PNG_COLOR_MASK_ALPHA) */ - png_set_strip_alpha(png_ptr); +#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR <= 2 && PNG_LIBPNG_VER_RELEASE < 40 + if (color_type & PNG_COLOR_MASK_ALPHA) +#endif + png_set_strip_alpha(png_ptr); if (bit_depth < 8) png_set_packing(png_ptr);