Use more accurate bit depth reduction for PNG images

This commit is contained in:
Dmitrij D. Czarkoff 2016-08-15 14:32:17 +02:00
parent b0fc6bfd5f
commit 2e3e80c1ee

View file

@ -233,7 +233,7 @@ int load_png(struct quirc *q, const char *filename)
png_set_tRNS_to_alpha(png_ptr); png_set_tRNS_to_alpha(png_ptr);
if (bit_depth == 16) if (bit_depth == 16)
png_set_strip_16(png_ptr); png_set_scale_16(png_ptr);
if (color_type & PNG_COLOR_MASK_ALPHA) if (color_type & PNG_COLOR_MASK_ALPHA)
png_set_strip_alpha(png_ptr); png_set_strip_alpha(png_ptr);