From 372e2b463b35e531a47d609f1b1d370c7d9e6171 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Thu, 10 Nov 2011 11:35:54 +0000 Subject: [PATCH] Correct a bug in ReadPNG() with GRAY_ALPHA images Change-Id: I4676160ee544ed914cc0de3f9cd140d9ee65addc --- examples/cwebp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/cwebp.c b/examples/cwebp.c index ef903284..e560f881 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -382,7 +382,8 @@ static int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha) { png_set_strip_16(png); png_set_packing(png); if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); - if (color_type == PNG_COLOR_TYPE_GRAY) { + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if (bit_depth < 8) { png_set_expand_gray_1_2_4_to_8(png); }