gdk_pixbuf_composite break



I've recorded this in bug #55148 but I'll repeat it here for everyone's convenience.

gdk_pixbuf_composite will produce an incorrect destination pixbuf when the edges of the source image have bright pixels, because of some wrongly signed function parameters. The break apparently will only show up when the destination pixbuf has an alpha channel (different code path in composite_pixel()). Patch is attached.

Doing this I was smote by an irritating lack of dependency. I am extremely clueless about automake, but I think the second attached patch would be prudent, or something like it. Perhaps some kind soul will commit it for me :)

Index: pixops.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/pixops/pixops.c,v
retrieving revision 1.16
diff -u -u -r1.16 pixops.c
--- pixops.c	2001/05/07 15:58:42	1.16
+++ pixops.c	2001/05/24 12:06:34
@@ -30,7 +30,7 @@
 typedef void (*PixopsPixelFunc) (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
 				 int src_has_alpha, int check_size, guint32 color1,
 				 guint32 color2,
-				 int r, int g, int b, int a);
+				 guint r, guint g, guint b, guint a);
 
 static int
 get_check_shift (int check_size)
@@ -321,7 +321,7 @@
 static void
 composite_pixel (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
 		 int src_has_alpha, int check_size, guint32 color1, guint32 color2,
-		 int r, int g, int b, int a)
+		 guint r, guint g, guint b, guint a)
 {
   if (dest_has_alpha)
     {
@@ -525,7 +525,7 @@
 static void
 composite_pixel_color (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
 		       int src_has_alpha, int check_size, guint32 color1, guint32 color2,
-		       int r, int g, int b, int a)
+		       guint r, guint g, guint b, guint a)
 {
   int dest_r, dest_g, dest_b;
   int check_shift = get_check_shift (check_size);
@@ -671,7 +671,7 @@
 static void
 scale_pixel (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
 	     int src_has_alpha, int check_size, guint32 color1, guint32 color2,
-	     int r, int g, int b, int a)
+	     guint r, guint g, guint b, guint a)
 {
   if (src_has_alpha)
     {
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/Makefile.am,v
retrieving revision 1.88
diff -u -u -r1.88 Makefile.am
--- Makefile.am	2001/05/07 15:58:40	1.88
+++ Makefile.am	2001/05/24 12:12:17
@@ -203,7 +203,7 @@
 	@LIBTOOL_EXPORT_OPTIONS@				\
 	$(GLIB_LIBS) 
 libgdk_pixbuf_1_3_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(GDK_PIXBUF_DEP_LIBS)
-libgdk_pixbuf_1_3_la_DEPENDENCIES = $(builtin_objs)
+libgdk_pixbuf_1_3_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs)
 
 libgdk_pixbufinclude_HEADERS =	\
 	gdk-pixbuf.h		\


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]