From 73d73eee2732759388cc02bc4ad4b784c3432e21 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 27 Jun 2010 21:52:52 +0000 Subject: Deal with API modification in modern libpng. svn path=/trunk/netsurf/; revision=10585 --- framebuffer/convert_image.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framebuffer/convert_image.c b/framebuffer/convert_image.c index 6b16c26dc..f601aaa54 100644 --- a/framebuffer/convert_image.c +++ b/framebuffer/convert_image.c @@ -22,6 +22,10 @@ #include #include +#if PNG_LIBPNG_VER < 10209 +#define png_set_expand_gray_1_2_4_to_8(png) png_set_gray_1_2_4_to_8(png) +#endif + static png_structp png; static png_infop info; static int interlace; @@ -221,7 +225,7 @@ info_callback(png_structp png, png_infop info) if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) - png_set_gray_1_2_4_to_8(png); + png_set_expand_gray_1_2_4_to_8(png); if (png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); if (bit_depth == 16) -- cgit v1.2.3