png loader: gray can have alpha
authorMatthias Clasen <mclasen@redhat.com>
Sat, 16 Jul 2022 03:07:59 +0000 (23:07 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 16 Jul 2022 13:43:46 +0000 (09:43 -0400)
gdk/loaders/gdkpng.c

index 20711210d0b9a9f1c880817bda8b86481df6fa42..c049868caf0427eb5169b5cf36989f5c7e422ed3 100644 (file)
@@ -184,7 +184,8 @@ gdk_load_png (GBytes  *bytes,
   if (color_type == PNG_COLOR_TYPE_PALETTE)
     png_set_palette_to_rgb (png);
 
-  if (color_type == PNG_COLOR_TYPE_GRAY)
+  if (color_type == PNG_COLOR_TYPE_GRAY ||
+      color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
     png_set_expand_gray_1_2_4_to_8 (png);
 
   if (png_get_valid (png, info, PNG_INFO_tRNS))