From 08fe9f7e0fedc400b46b1f992089355ebd1056d9 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Tue, 6 Sep 2016 08:08:58 +1200 Subject: [PATCH] Fall back to set_strip() on older libpng versions. Latest Debian release right now packages only 1.2.50. --- tests/dbgutil.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/dbgutil.c b/tests/dbgutil.c index ca61644..6dd492e 100644 --- a/tests/dbgutil.c +++ b/tests/dbgutil.c @@ -234,7 +234,11 @@ int load_png(struct quirc *q, const char *filename) png_set_tRNS_to_alpha(png_ptr); if (bit_depth == 16) +#if PNG_LIBPNG_VER >= 10504 png_set_scale_16(png_ptr); +#else + png_set_strip_16(png_ptr); +#endif if ((trns) || color_type & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha(png_ptr);