Browse Source

Fix for plPNG::IRead improperly handling 24-bit RGB and non-transparent paletted images.

Joseph Davies 13 years ago
parent
commit
090c950c74
  1. 4
      Sources/Plasma/PubUtilLib/plGImage/plPNG.cpp

4
Sources/Plasma/PubUtilLib/plGImage/plPNG.cpp

@ -127,6 +127,10 @@ plMipmap* plPNG::IRead(hsStream* inStream)
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
png_set_tRNS_to_alpha(png_ptr);
channels += 1;
} else if (channels == 3) {
// Add an opaque alpha channel if still none exists
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
channels = 4;
}
// Invert color byte-order as used by plMipmap for DirectX

Loading…
Cancel
Save