X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ecere%2Fsrc%2Fgfx%2Fbitmaps%2FPNGFormat.ec;h=a7a474056b9221e4fe9f46218f8e42b317e385f1;hb=bbf61aa1493511731c707ebc71c1ef0863f5fbcb;hp=ee18986151576aa1d6c8b532183c3b72ca5bf4fc;hpb=a097f6e4a1c5360a75d9588502a0442844f8bf26;p=sdk diff --git a/ecere/src/gfx/bitmaps/PNGFormat.ec b/ecere/src/gfx/bitmaps/PNGFormat.ec index ee18986..a7a4740 100644 --- a/ecere/src/gfx/bitmaps/PNGFormat.ec +++ b/ecere/src/gfx/bitmaps/PNGFormat.ec @@ -88,6 +88,11 @@ class PNGFormat : BitmapFormat if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); numPasses = png_set_interlace_handling(png_ptr); + if(color_type == PNG_COLOR_TYPE_PALETTE) + { + png_set_palette_to_rgb(png_ptr); + channels = 4; + } if((result = bitmap.Allocate(null, (uint)width, (uint)height, 0, pixelFormatRGBA, false))) {