From 443bb5576f8f9d48c58bcce7dfb3d9207ef00c64 Mon Sep 17 00:00:00 2001 From: Alexandre Perrin Date: Mon, 18 Jul 2016 14:23:08 +0200 Subject: [PATCH] PNG_COLOR_TYPE_PALETTE support for inspect and qrtest. --- tests/dbgutil.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/dbgutil.c b/tests/dbgutil.c index 2b040ff..39abc00 100644 --- a/tests/dbgutil.c +++ b/tests/dbgutil.c @@ -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); }