GNOME Bugzilla – Bug 105731
png comments
Last modified: 2004-12-22 21:47:04 UTC
i would like to be able to write a comment to my pngs, both via gui and via the pdb (like jpeg works now would be great).
IIRC, the PNG file format doesn't have a dedicated comment entry. It supports textual key / value pairs however.
I have been wrong. The PNG spec defines a set of predefined keys: http://www.libpng.org/pub/png/spec/PNG-Chunks.html (section 4.2.3) We should probably limit ourselves to using iTXt chunks to avoid trouble with encodings.
PNG does have a dedicated comment field. You can store it inside a tEXt, zTXt or iTXt chunk (the latter is probably better, as it is UTF-8). The specs mention that these chunks can contain the "Comment" keyword, which is reserved for "Miscellaneous comment; conversion from GIF comment". However, it is recommended to use more appropriate keywords whenever possible. The reserved keywords include: Title, Author, Description, Copyright, Creation Time, Software (GIMP!), Disclaimer, Warning, Source and Comment. Reference: http://www.libpng.org/pub/png/spec/PNG-Chunks.html It would be possible to add one or several entry fields in the dialog created by the PNG plug-in, allowing the user to edit the comment and other fields. However, I think that it would be much more appropriate to spend this time on a better solution, as described in bug #61499. It would be better to remove the comment entry field from the GIF and JPEG plug-ins and to have a single plug-in providing a common interface for editing these properties. Otherwise, each plug-in will implement the same thing in a slightly different way.
Mid-air collision between Sven's comment and mine. I have submitted my changes anyway. Looks like I did not destroy anything... Good! ;-)
Basic support for reading and writing the "Comment" chunk and mapping it to the gimp-comment parasite is now in CVS: 2003-07-03 Sven Neumann <sven@gimp.org> * plug-ins/common/png.c: added support for reading and writing comments. Handles tTXt (ISO-8859-1) and, if your libpng supports it, iTXt (UTF-8) chunks.
what else needs to be done before you consider this fixed? nice work by the way.
Changes at the request of Dave Neary on the developer mailing list. I am changing many of the bugzilla reports that have not specified a target milestone to Future milestone. Hope that is acceptable.
I think we can consider this closed - if there are any extra issues, they should probably be addressed in different bugs. Dave.