Merge remote branch 'refs/remotes/origin/parasti/fix-grayscale-png'
This commit is contained in:
commit
062ff7a05f
|
|
@ -104,7 +104,10 @@ Image* LoadPNGBuff (unsigned char* fbuffer)
|
||||||
// The following code transforms grayscale images of less than 8 to 8 bits,
|
// The following code transforms grayscale images of less than 8 to 8 bits,
|
||||||
// changes paletted images to RGB, and adds a full alpha channel if there is
|
// changes paletted images to RGB, and adds a full alpha channel if there is
|
||||||
// transparency information in a tRNS chunk.
|
// transparency information in a tRNS chunk.
|
||||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
|
||||||
|
if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||||
|
png_set_gray_to_rgb(png_ptr);
|
||||||
|
else if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
png_set_palette_to_rgb(png_ptr);
|
png_set_palette_to_rgb(png_ptr);
|
||||||
|
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
|
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user