Skip to content

Commit

Permalink
[Fixed] Wrong handling of 8bit images
Browse files Browse the repository at this point in the history
(cherry picked from commit 6675294aa4545249262f8a434ad5c39112759b71)
  • Loading branch information
DimitarCC authored and jbleyel committed Oct 15, 2024
1 parent 7662df4 commit b084bb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gdi/picload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static void png_load(Cfilepara *filepara, unsigned int background)
filepara->transparent = (trans_alpha != NULL);
}

if ((bit_depth <= 8) && (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE))
if ((bit_depth <= 8) && (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE || color_type == PNG_COLOR_TYPE_RGBA))
{
if (bit_depth < 8)
png_set_packing(png_ptr);
Expand Down

0 comments on commit b084bb9

Please sign in to comment.