Correct a bug in ReadPNG() with GRAY_ALPHA images

Change-Id: I4676160ee544ed914cc0de3f9cd140d9ee65addc
This commit is contained in:
Urvang Joshi 2011-11-10 11:35:54 +00:00 committed by James Zern
parent 469d6eb974
commit 372e2b463b

View File

@ -382,7 +382,8 @@ static int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha) {
png_set_strip_16(png); png_set_strip_16(png);
png_set_packing(png); png_set_packing(png);
if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(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) { if (bit_depth < 8) {
png_set_expand_gray_1_2_4_to_8(png); png_set_expand_gray_1_2_4_to_8(png);
} }