Gimp-Forum.net

Full Version: What happens to metadata in GIMP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering what happens to metadata in Gimp. I was having fun playing with some programming languages to create an image editor. I understand that in broad terms the structure is this:

I have a .jpg photo that I want to edit, I upload it to the editor, the editor generally uses an external library to read the .jpg file; it takes this file, decompresses it, isolates the bits relating to the actual image which will form an array of pixels of the exact dimensions of the image that will be shown on the screen.


At this point each editor will have its own functionality for editing the photo.


Once you have achieved the desired result you can export the photo again as .jpg. The edited pixel array is taken and compressed again into a .jpg file via an external library.


I wanted to understand what happens to the metadata in this process in Gimp. I tried to read the Gimp source code but I didn't understand.


I'm interested in understanding well what the final exported .jpg image is made of. If it is composed of the compressed pixel array of the edited image + some metadata created by Gimp useful for the final file (Such as resolution and size) + any metadata from the original file that Gimp recognizes and copies into the new one (Asking you during export if you want to keep them or not and allowing you to modify them).


Or could it happen that Gimp adds metadata present in the original photo to the final .jpg but does not recognize it and does not show it in the metadata viewer or editor?


If anyone knows any places within the Gimp code where I can understand this, it would be very useful for me.

AFAIK the original metadata (EXIF, XMP, IPTC, and also the image comment and resolution) are copied to the output file. The only exception is the image orientation, which is reset.
So all metadata unknown to Gimp are deleted, correct?
In the final file .jpg (if when I export the file I unselect EXIF, XMP, IPTC and the comment) there are only resolution and orientation as metadata?
Experimentally, see attached file. Two pictures, one from my phone, and one from my camera:
  • source is the original photo (for the pone, transferred by accessing the phone as a mass media)
  • shared (phone only) is the photo s exported when you use a "Share..." link (some privacy-invading data such as GPS are removed).
  • edited-full is the picture edited in Gimp and exported with all metadata (EXIF+IPTC+XMP turned on)
  • edited-censored is the same picture with no metadata (EXIF+IPTC+XMP turned off)
For all pictures, metadata extracted using ExifTool and then sorted to make comparison easier.
Thanks, very interesting. I hadn't thought about doing a test and check the results with exiftool. Now what happens to the metadata in the process is clearer to me. Do you know any resources to better understand what the final .jpg file is composed of in detail when an image is exported? What libraries and functions in C are used?

Thanks.
I think the user can choose what image data to export. Check the Gimp jpeg export options?

[attachment=11072]