PNG_COLOR_TYPE_PALETTE support for inspect and qrtest.

This commit is contained in:
Alexandre Perrin 2016-07-18 14:23:08 +02:00
parent 3a6efb3d84
commit 443bb5576f

View file

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