GNOME Bugzilla – Bug 729581
Support loading/saving metadata
Last modified: 2014-10-22 17:40:23 UTC
Many applications rely on gdk-pixbuf to load and save image files, including Eye of GNOME (except for JPG). gdk-pixbuf does not load any metadata, nor support saving it. While applications could use gexiv2 to do this, it would be better to have this integrated into the file loaders, as that would be more efficient and sometimes file format technical information must be merged with the metadata describing the image context (e.g. title, creator, rights etc). A suggested implementation is that gdk-pixbuf is extended to load metadata into a gexiv2 object, which applications can access to through the gdk-pixbuf API. It can perhaps just be a new property on the pixbuf, rather than requiring new API methods. This would only be available if gexiv2 is installed, to avoid introducing a hard dependency on that library. Applications like EOG can then be extended to use this when modifying images. A rotation can then look like this in eog: - Load a PNG into a pixbuf, having the file loader also read the metadata into a gexiv2 object that is available as a property on the pixbuf - Allocate a new pixbuf for the rotated image - Copy the pixels, rotating the image - Copy the gexiv2 object into the metadata property on the new pixbuf - Save the pixbuf to a new PNG file, having the file saver call gexiv2 to include the metadata in the saved file At LGM this was briefly discussed (Peter Liljenberg/commons machinery, Richard Hughes, me and one or two others) with the agreement that while gdk-pixbuf is likely slated to be replaced by Cairo surfaces, those will initially rely on gdk-pixbuf for file operations. Later, the existing file loaders/savers in gdk-pixbuf would likely be migrated to Cairo, so the effort now in extending them to handle metadata would still be useful. The work done in the file loaders/savers in GIMP to handle metadata with gexiv2 can serve as a model, and possibly even a source of some code, for the gdk-pixbuf file loaders. See e.g.: https://git.gnome.org/browse/gimp/tree/libgimpbase/gimpmetadata.c https://git.gnome.org/browse/gimp/tree/libgimp/gimpmetadata.c https://git.gnome.org/browse/gimp/tree/plug-ins/file-jpeg/jpeg.c
If you need to really handle metadata for file formats, best would be to use a library just for that purpose. gdk-pixbuf is a library for simple viewers and desktop functionality, not a "GStreamer of images". I'll close this as WONTFIX as I doubt that, given some of the bugs I've triaged today, gdk-pixbuf would ever have the resources to handle such features.