Fall back to set_strip() on older libpng versions.

Latest Debian release right now packages only 1.2.50.
This commit is contained in:
Daniel Beer 2016-09-06 08:08:58 +12:00
parent 5b26248009
commit 08fe9f7e0f

View file

@ -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);