GNOME Bugzilla – Bug 653882
dia-0.97.1 fix for libpng-1.5
Last modified: 2011-07-04 01:29:17 UTC
Created attachment 191173 [details] [review] dia-0.97.1 fix for libpng 1.5 dia-0.97.1 presently fails when compiled against libpng-1.5 due to it directly accessing libpng's private structure members which is officially deprecated now. Currently, libpng-1.5 users will receive an error similar to the following: export_png.c: In function ‘export_png_ok’: export_png.c:181: error: dereferencing pointer to incomplete type make: *** [export_png.lo] Error 1 Attached is a patch that corrects dia for libpng-1.5, with one bug: the blue channel is not written, so the image is exported with a distinct yellow colouring. I'll attach an updated patch if I figure out how to fix that, but at least it compiles with the attached patch.
Thanks for the fix. It is already available in both branches. For dia-0-97 see: http://git.gnome.org./browse/dia/commit/?id=59f67782b9e382b2d71aeabbd493799b179bdec0 (bug #642764) For the missing blue channel: it does not happen for me with libpng-1.4.3
Ahh okay, so really this should be a duplicate of bug 642764… :-) I did some further investigations, I got the missing blue channel if I exported using "Cairo (PNG)". If I tell it to use PNG (further down the list), it exports fine. I have been trying to build the later Inkscape releases to see if it too, exhibits the same fault, as it could be Cairo misbehaving. The machine I'm seeing this on is a P4 2GHz laptop, getting a bit long in the tooth so builds take a while. :-)
Okay, I can be pretty certain that the bug I'm seeing now is either a bug in Cairo or libpng when exporting 24-bit RGB PNGs. I do not see colour issues when exporting RGBA PNGs via Cairo, or when exporting directly using the "PNG (anti aliased)" option, but I do see it when exporting PNGs using Cairo without the alpha channel. So the libpng-1.5 fix is a duplicate, and the yellow images are a Cairo bug as best I can determine. Resolving as duplicate and taking my bug over to freedesktop.org bugzilla. *** This bug has been marked as a duplicate of bug 642764 ***