Don't request alpha channel when loading monochrome PNG

This commit is contained in:
Nikita Lisitsa 2023-11-03 11:33:01 +03:00
parent f9dda53c61
commit de1a454079

View file

@ -67,7 +67,7 @@ namespace psemek::gfx
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
png_set_expand_gray_1_2_4_to_8(png);
if (!(color_type & PNG_COLOR_MASK_ALPHA))
if (!(color_type & PNG_COLOR_MASK_ALPHA) && !monochrome)
png_set_add_alpha(png, 0xff, PNG_FILLER_AFTER);
png_read_update_info(png, info);