GNOME Bugzilla – Bug 719621
Rotating image destroys XMP and IPTC metadata
Last modified: 2021-06-19 08:47:52 UTC
Created attachment 263218 [details] Sample image after rotation. I rotated and saved an image with a lot of XMP metadata. All the XMP and IPTC metadata where not saved to the rotated copy.
Created attachment 263219 [details] Sample image before rotation.
I can confirm that this bug in Eye of GNOME 3.12.0.
Okay, it seems eog's JPEG saving code does not copy over any metadata besides the JPEG comment (Exif is injected later). Odd! Copying over the other metadata is not much of a problem, besides for XMP which shares the JPEG block id with Exif. Unfortunately writing out the XML again during save produces larger XMP data (some odd padding is injected) and misses a few tags (could be they are deprecated). I'll need to look into that a bit further.
I have also tested *.tiff and *.png which seem to loose their imagedata as well when rotated using eog 3.12.
There was some brief discussion about this at LGM and it was agreed that perhaps implementing support for loading and saving metadata would reside best in gdk-pixbuf (and later Cairo Surfaces). For now, I have filed a bug about it: https://bugzilla.gnome.org/show_bug.cgi?id=729581
I'm not a coder, but seems strange that it would necessary to hope that an external library can be re-invented to avoid deleting data. If exif data gets preserved, why not xmp data? It may be that, in the long run, this would be better handled via some external process, but in the meantime, could there not be some workaround to avoid deleting data?
OK, since the idea to extend gdk-pixbuf has been marked WONTFIX, what is the next best option for EoG?
This does not seem related. Or is it? https://bugzilla.gnome.org/show_bug.cgi?id=465506
Well, an option could be to have libjpeg copy as much metadata blocks as possible while skipping Exif and XMP blocks. If the XMP padding oddness cannot be resolved backing up the RAW XMP data during load would also become necessary.
Retested with eog 3.10 and the issue remains the same. Rotating and resaving an image deletes most metadata.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/eog/-/issues/ Thank you for your understanding and your help.