[racket-dev] [PATCH] Use png_set_expand_gray_1_2_4_to_8 when compiling with libpng-1.4

From: Mariusz Ceier (mceier at gmail.com)
Date: Tue Sep 14 16:24:41 EDT 2010

According to [1] png_set_gray_1_2_4_to_8 was renamed to
png_set_expand_gray_1_2_4_to_8 in libpng-1.4.0

[1] http://libpng.sourceforge.net/ANNOUNCE-1.4.0.txt

Signed-off-by: Mariusz Ceier <mceier at gmail.com>
---
 src/wxcommon/wxJPEG.cxx |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/wxcommon/wxJPEG.cxx b/src/wxcommon/wxJPEG.cxx
index 053a3ee..a13d760 100644
--- a/src/wxcommon/wxJPEG.cxx
+++ b/src/wxcommon/wxJPEG.cxx
@@ -726,7 +726,11 @@ int wx_read_png(char *file_name, wxBitmap *bm, int w_mask, wxColour *bg)
        png_set_strip_16(png_ptr);
 
      /* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
+#if PNG_LIBPNG_VER >= 10400
+     png_set_expand_gray_1_2_4_to_8(png_ptr);
+#else
      png_set_gray_1_2_4_to_8(png_ptr);
+#endif
    }
 
    /* Set the background color to draw transparent and alpha images over.
-- 
1.7.2.2



Posted on the dev mailing list.