After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 92395 - Do not save background chunk in non-transparent PNG images
Do not save background chunk in non-transparent PNG images
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: Plugins
1.x
Other All
: Normal enhancement
: 1.2
Assigned To: GIMP Bugs
Daniel Egger
Depends on:
Blocks:
 
 
Reported: 2002-09-03 11:13 UTC by Raphaël Quinet
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
tiny patch that deselects the bKGD chunk for opaque images (754 bytes, patch)
2002-09-03 11:16 UTC, Raphaël Quinet
none Details | Review

Description Raphaël Quinet 2002-09-03 11:13:21 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.
Comment 1 Raphaël Quinet 2002-09-03 11:16:19 UTC
Created attachment 10872 [details] [review]
tiny patch that deselects the bKGD chunk for opaque images
Comment 2 Sven Neumann 2002-09-03 11:18:41 UTC
Looks reasonable to me.
Comment 3 Sven Neumann 2002-11-06 20:27:31 UTC
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).
Comment 4 Raphaël Quinet 2003-06-20 16:39:56 UTC
The fix is part of the stable release 1.2.4.  Closing this bug.