unneeded buggy code in gdk-pixbuf PGN saving



Hi,

gdk_pixbuf__png_image_save() in io-png.c does voodoo things to RGBA
pixbufs, resulting in _BGRA_ PNGs being saved. Also, the endian
conversion seems useless. At least I didn't find any of the statements
removed in the GIMP png plug-in:


Index: gdk-pixbuf/io-png.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/io-png.c,v
retrieving revision 1.42
diff -u -p -r1.42 io-png.c
--- gdk-pixbuf/io-png.c 2001/10/05 18:51:47     1.42
+++ gdk-pixbuf/io-png.c 2001/12/10 11:35:28
@@ -823,11 +823,6 @@ gdk_pixbuf__png_image_save (FILE        
                png_set_IHDR (png_ptr, info_ptr, w, h, bpc,
                              PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
                              PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
-#ifdef WORDS_BIGENDIAN
-               png_set_swap_alpha (png_ptr);
-#else
-               png_set_bgr (png_ptr);
-#endif
        } else {
                png_set_IHDR (png_ptr, info_ptr, w, h, bpc,
                              PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,


Removing the #ifdef stuff produces the expected results (and endian
conversion should be the job of libpng itself)...

OK to commit?

ciao,
--Mitch



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