Gimp 2.10.10 is mangling EXIF data
GIMP version: 2.10.10
Operating System: Xubuntu 18.10
Package: Standard Debian Repository
Gimp has been screwing up my EXIF Metadata for a while and I decided to take a closer look and see what's going on. There are at least three other open bug reports on JPEG Metadata problems (#1137 (closed), #1367 (closed), #1485 (closed)) but I thought a new report was necessary to address this specific issue.
I use the ImageDescription field to set my descriptions for the image. On occasion, I use the UserComment field as well. I generally have avoided the Comment field. Of course, all of this is personal preference. I don't use Gimp to edit the EXIF data, but handle this externally with some custom tools built upon exiftool(1). I need Gimp to stop destroying existing information that has already been set.
Demonstration of the problem:
Set the EXIF ImageDescription of a jpg file (dsc160.jpg) to "IIII", the UserComment to "UUUU", and the Comment field to "CCCC"
1-> exiftool -m -f -ImageDescription -UserComment -Comment dsc160.jpg
Image Description : IIII
User Comment : UUUU
Comment : CCCC
Open and Edit the file (dsc160.jpg) in Gimp
Look at the EXIF Metadata in Gimp
Image -> Metadata -> View Metadata
The ImageDescription and UserComment are shown, but not the Comment
[See Image #1]
Save it to the same file:
Ctrl-E -> Export -> Replace
[Note: The Comment box is filled in with the UserComment ("UUUU"),
not the Comment field!]
Export
All three fields have now been overwritten by "UUUU"!
2-> exiftool -m -f -ImageDescription -UserComment -Comment dsc160.jpg
Image Description : UUUU
User Comment : UUUU
Comment : UUUU
With the same file still loaded in Gimp, Save it to a new name (xxxx.jpg)
Ctrl-Shift-E
Set name to xxxx.jpg
Export
Leave the Comment field as is (i.e., "UUUU")
Export
Same result as the overwritten file
2-> exiftool -m -f -ImageDescription -UserComment -Comment xxxx.jpg
Image Description : UUUU
User Comment : UUUU
Comment : UUUU
With the same file still loaded in Gimp, Save it to a new name (yyyy.jpg)
Ctrl-Shift-E
Set name to yyyy.jpg
Export
This time enter a new Comment: "GIMP COMMENT"
Export
However, the Comment (not UserComment) field is being updated!
2-> exiftool -m -f -ImageDescription -UserComment -Comment yyyy.jpg
Image Description : UUUU
User Comment : UUUU
Comment : GIMP TEST
And still within Gimp, the Metadata continues to display the original ImageDescription and UserComment values ("IIII" and "UUUU"), while the newly set Comment remains missing.
Things needing to be fixed and some suggestions:
1: Since Gimp is writing to the EXIF Comment field, it should be displaying this value in the Metadata viewer.
2: If Gimp is going to write the Export Comment to the EXIF Comment field, then it absolutely MUST import the string from the Comment field into the menu's Comment field. It should NOT be displaying the UserComment value!
3: The ImageDescription and UserComment fields are being read in properly (as per viewer) and should be written back correctly -- or better yet, not touched at all. Gimp should not be overwriting these fields as it is silently destroying user data.
4: If you want to provide flexibility to handle various user preferences, you could provide a saved option to let each user choose whether they preferred the ImageDescription, UserComment, or Comment field as their preference. Then, this is the value that would be imported, displayed on the Export menu and saved. The title over the Comment box would update to reflect which of the three comment options was active.
5: Taking #4 (closed) further, you could provide check boxes for
Image Description
User Comment
Comment
On the Export menu, giving the user the option of overwriting any/all of these fields with the comment in the box. However, this might just cause more confusion than benefit.
I consider this a critical bug and hope it can be addressed in a bug-fix release soon.