Merge pull request #10 from kAworu/PNG_COLOR_TYPE_PALETTE

PNG_COLOR_TYPE_PALETTE support for inspect and qrtest.
This commit is contained in:
Daniel Beer 2016-07-20 07:49:19 +12:00 committed by GitHub
commit 7ee3a62b1a

View file

@ -228,7 +228,11 @@ int load_png(struct quirc *q, const char *filename)
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);
if (color_type == PNG_COLOR_TYPE_RGB || if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_palette_to_rgb(png_ptr);
if (color_type == PNG_COLOR_TYPE_PALETTE ||
color_type == PNG_COLOR_TYPE_RGB ||
color_type == PNG_COLOR_TYPE_RGB_ALPHA) { color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
png_set_rgb_to_gray_fixed(png_ptr, 1, -1, -1); png_set_rgb_to_gray_fixed(png_ptr, 1, -1, -1);
} }