[kde-sunset] gwenview-1.4.2-r3 doesn't compile with libpng-1.4.2 (patch included)

Jens Rutschmann <[email protected]>
Newsgroups gmane.linux.gentoo.desktop
Message-ID <[email protected]>
Hi all,

apparently the gwenview code includes some copied source files from qt3.

At least compiling it against libpng-1.4.2 fails with the same errors as qt3 did. Parts of the patch for qt3 from the 
kde-sunset overlay can be applied to gwenview as well.

I modified it a bit and attached it to this email. Place it in the files dir and change the "PATCHES" variable in the 
ebuild as follows and gwenview should compile again.



PATCHES=(
	"${FILESDIR}/gwenview-1.4.2-exiv2.patch"
	"${FILESDIR}/gwenview-1.4.2-desktop-file.diff"
	"${FILESDIR}/gwenview-libpng14.patch"
	)



Best regards,
Jens
gwenview-libpng-14.patch (text/plain, 952 B)
--- src/gvcore/pngformattype.cpp	2007-09-15 15:46:13.000000000 +0200
+++ src/gvcore/pngformattype.cpp	2010-05-16 23:40:09.057829081 +0200
@@ -245,7 +245,11 @@
 		image.setColor( i, qRgba(c,c,c,0xff) );
 	    }
 	    if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
-		const int g = info_ptr->trans_values.gray;
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 )
+		const int g = info_ptr->trans_color.gray;
+#else
+ 		const int g = info_ptr->trans_values.gray;
+#endif
 		if (g < ncols) {
 		    image.setAlphaBuffer(TRUE);
 		    image.setColor(g, image.color(g) & RGB_MASK);
@@ -273,7 +277,11 @@
 		    info_ptr->palette[i].red,
 		    info_ptr->palette[i].green,
 		    info_ptr->palette[i].blue,
-		    info_ptr->trans[i]
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 )
+		    info_ptr->trans_alpha[i]
+#else
+ 		    info_ptr->trans[i]
+#endif
 		    )
 		);
 		i++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.