GNOME Bugzilla – Bug 92395
Do not save background chunk in non-transparent PNG images
Last modified: 2009-08-15 18:40:50 UTC
From the libpng homepage (http://www.libpng.org/pub/png/pngaped.html): The GIMP (GNU Image Manipulation Program) [...] writes bKGD chunks even for opaque images (not a bug in itself, but triggers one in Netscape 4.x) The PNG Save dialog has the "save background chunk" option checked by default. This is not very useful for opaque images, and as mentioned above this triggers a bug in Netscape 4.x (all black pixels are rendered with the background color, which is often white and therefore destroys most of the image). Regardless of whether or not we care for browser bugs (this was already rejected in bug #62847), it would be better to uncheck the "save background chunk" option if the image has no alpha channel. The following (very small) patch fixes that problem: in interactive mode, it deselects the bKGD option if the image has no alpha channel (of course, the user can still change that before saving). I suggest to apply this patch to 1.2.4 so that users of the stable version would save images that work better for the web. And the GIMP would have one less bug mentioned on the libpng homepage.
Created attachment 10872 [details] [review] tiny patch that deselects the bKGD chunk for opaque images
Looks reasonable to me.
Applied patch to both branches: 2002-11-06 Sven Neumann <sven@gimp.org> * plug-ins/common/png.c: applied patch from Raphael Quinet that untoggles the "Save background color" option for images w/o an alpha channel (#92395).
The fix is part of the stable release 1.2.4. Closing this bug.