radiant: fix alpha channel for palette-with-transparency png 102/head
authorThomas Debesse <dev@illwieckz.net>
Sun, 15 Jul 2018 18:44:12 +0000 (20:44 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 2 Oct 2018 23:24:04 +0000 (01:24 +0200)
plugins/imagepng/plugin.cpp

index 8a9f582..65ae595 100644 (file)
@@ -114,9 +114,7 @@ Image *LoadPNGBuff(unsigned char *fbuffer)
 
     if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
         png_set_tRNS_to_alpha(png_ptr);
-    }
-
-    if (!(color_type & PNG_COLOR_MASK_ALPHA)) {
+    } else if (!(color_type & PNG_COLOR_MASK_ALPHA)) {
         // Set the background color to draw transparent and alpha images over.
         png_color_16 my_background, *image_background;