--- fvwm-2.5.30.ds.orig/libs/PictureImageLoader.c
+++ fvwm-2.5.30.ds/libs/PictureImageLoader.c
@@ -458,18 +458,25 @@
 	{
 		Fpng_set_expand(Fpng_ptr);
 	}
-	if (Finfo_ptr->color_type == FPNG_COLOR_TYPE_RGB_ALPHA)
 	{
-		hasa = 1;
-	}
-	if (Finfo_ptr->color_type == FPNG_COLOR_TYPE_GRAY_ALPHA)
-	{
-		hasa = 1;
-		hasg = 1;
-	}
-	if (Finfo_ptr->color_type == FPNG_COLOR_TYPE_GRAY)
-	{
-		hasg = 1;
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+		int png_color_type = png_get_color_type(Fpng_ptr, Finfo_ptr);
+#else
+		int png_color_type = Finfo_ptr->color_type;
+#endif
+		if (png_color_type == FPNG_COLOR_TYPE_RGB_ALPHA)
+		{
+			hasa = 1;
+		}
+		if (png_color_type == FPNG_COLOR_TYPE_GRAY_ALPHA)
+		{
+			hasa = 1;
+			hasg = 1;
+		}
+		if (png_color_type == FPNG_COLOR_TYPE_GRAY)
+		{
+			hasg = 1;
+		}
 	}
 	if (hasa)
 		Fpng_set_expand(Fpng_ptr);
