summaryrefslogtreecommitdiff
path: root/graphics/imlib/patches/patch-aa
blob: c4c76d978f2d70383b17373a31ee129253ee00bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$NetBSD: patch-aa,v 1.11 2000/06/17 01:09:36 wiz Exp $

--- gdk_imlib/io-png.c.orig	Sun Oct  3 21:17:35 1999
+++ gdk_imlib/io-png.c	Sat Jun 17 02:58:44 2000
@@ -61,6 +61,9 @@
   /* Setup Translators */
   if (color_type == PNG_COLOR_TYPE_PALETTE)
     png_set_expand(png_ptr);
+  if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
+    png_set_expand(png_ptr);
+
   png_set_strip_16(png_ptr);
   png_set_packing(png_ptr);
   if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
@@ -97,7 +100,8 @@
   png_read_image(png_ptr, lines);
   png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
   ptr = data;
-  if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+  if (color_type == PNG_COLOR_TYPE_GRAY
+      || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
     {
       for (y = 0; y < *h; y++)
 	{
@@ -122,6 +126,7 @@
 	    }
 	}
     }
+#if 0
   else if (color_type == PNG_COLOR_TYPE_GRAY)
     {
       for (y = 0; y < *h; y++)
@@ -136,6 +141,7 @@
 	    }
 	}
     }
+#endif
   else
     {
       for (y = 0; y < *h; y++)