Skip to content

Commit

Permalink
Merge pull request #1627 from Deledrius/grey_res
Browse files Browse the repository at this point in the history
Support Greyscale PNGs created by Pngcrush.
  • Loading branch information
Hoikas authored Nov 14, 2024
2 parents 61175a8 + a690e68 commit a79c788
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/Plasma/PubUtilLib/plGImage/plPNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ plMipmap* plPNG::IRead(hsStream* inStream)
channels = 3;
break;
case PNG_COLOR_TYPE_GRAY:

if (bitdepth < 8) {
if (bitdepth < 8)
png_set_expand_gray_1_2_4_to_8(png_ptr);
}

bitdepth = 8;
[[fallthrough]];
case PNG_COLOR_TYPE_GRAY_ALPHA:
png_set_gray_to_rgb(png_ptr);
channels = 3;
break;
}

Expand Down

0 comments on commit a79c788

Please sign in to comment.