Bug 473826 - digikam with exiftool backend erases XMP tags
Summary: digikam with exiftool backend erases XMP tags
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 8.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-27 23:58 UTC by karlicoss
Modified: 2023-09-01 20:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.2.0
Sentry Crash Report:


Attachments
diff of exif data before/after digikam (300.45 KB, image/png)
2023-08-27 23:58 UTC, karlicoss
Details
tags before writing meta with digikam (8.23 KB, text/plain)
2023-08-30 01:14 UTC, karlicoss
Details
tags after writing meta with digikam (exiftool backend) (7.81 KB, text/plain)
2023-08-30 01:15 UTC, karlicoss
Details
tags after writing meta with digikam (exiv backend) (8.53 KB, text/plain)
2023-08-30 01:15 UTC, karlicoss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description karlicoss 2023-08-27 23:58:54 UTC
Created attachment 161232 [details]
diff of exif data before/after digikam

I tried using digikam with exiftool backend (exiftool version 12.40) -- tried setting some photo tags, and found out that most XMP original metadata from my photos is erased.

I dumped the metadata before and after applying changes in digikam (with "exiftool -G") and compared the results (attached the diff as a screeenshot).

In particular it loses XMP tags like "MotionPhoto": 1, which makes me worried that they won't be detected as motion photos after processing with digikam.

I tried setting the tag with command like exiftool instead -- and the same is happening. I guess this is due to XMP Toolkit of exiftool not knowing anything about the original tags the phone camera sets (original xmp toolkit is Adobe XMP Core 5.1.0-jc003). So I imagine it's more of an exiftool issue (here's a similar issue someone having with exiftool https://exiftool.org/forum/index.php?topic=11901.0 ).

But I guess could be useful if digikam was a bit more explicit about removing tags unrelated to the ones I was originally changing.
Comment 1 Maik Qualmann 2023-08-28 05:48:01 UTC
Can you provide a sample file if not public to my email address?

Maik
Comment 2 caulier.gilles 2023-08-28 06:04:14 UTC
Q : the problem is reproducible with the Exiv2 backend ?
If you use a more recent Exiftool version, this do not fix the problem ?

Gilles Caulier
Comment 3 karlicoss 2023-08-30 01:13:55 UTC
(In reply to Maik Qualmann from comment #1)
> Can you provide a sample file if not public to my email address?
> 
> Maik

here you go (can't attach here because it's bigger than Mb), hope google drive is ok https://drive.google.com/file/d/1k-o6i3PwhpsHx60zEAFOEXSosmB161EB/view?usp=drive_link

(In reply to caulier.gilles from comment #2)
> Q : the problem is reproducible with the Exiv2 backend ?
> If you use a more recent Exiftool version, this do not fix the problem ?
> 
> Gilles Caulier

Nope, doesn't happen with exiv2. The actual reason I tried exiftool backend in the first place (and upgraded digikam from version 7 to version 8) is because exiv was stripping some other tags (e.g. GPSDateTime), which stopped after upgrading Digikam -- I'll file a bug report for that if I notices.

Actually I was wrong about exiftool stripping the tags -- at least on that photo exiftool preserves XMP tags so perhaps it is a digikam issue after all. I attached the metadata for the photo in the link above, before and after writing the metadata from digikam, with exiv and exiftool backends.
Comment 4 karlicoss 2023-08-30 01:14:58 UTC
Created attachment 161272 [details]
tags before writing meta with digikam
Comment 5 karlicoss 2023-08-30 01:15:14 UTC
Created attachment 161273 [details]
tags after writing meta with digikam (exiftool backend)
Comment 6 karlicoss 2023-08-30 01:15:26 UTC
Created attachment 161274 [details]
tags after writing meta with digikam (exiv backend)
Comment 7 Maik Qualmann 2023-08-31 11:38:51 UTC
@karlicoss, the link you sent me is not public, you have not yet confirmed my link sharing request via Google.
I can't reproduce the problem with images (e.g. the one from the ExifTool forum) and web.

Maik
Comment 8 karlicoss 2023-08-31 19:45:33 UTC
(In reply to Maik Qualmann from comment #7)
> @karlicoss, the link you sent me is not public, you have not yet confirmed
> my link sharing request via Google.
> I can't reproduce the problem with images (e.g. the one from the ExifTool
> forum) and web.
> 
> Maik

Apologies! I shared sharing settings to public so anyone can view
Comment 9 Maik Qualmann 2023-09-01 20:07:22 UTC
Git commit af1fd3112e0f33a48432d3375bf8253770ff3aa3 by Maik Qualmann.
Committed on 01/09/2023 at 22:06.
Pushed by mqualmann into branch 'master'.

remove metadata groups only needed for writing
FIXED-IN: 8.2.0

M  +1    -1    NEWS
M  +6    -2    core/libs/metadataengine/engine/metaengine.cpp
M  +6    -4    core/libs/metadataengine/engine/metaengine_p.cpp
M  +1    -1    core/libs/metadataengine/exiftool/exiftoolparser.h
M  +41   -9    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/-/commit/af1fd3112e0f33a48432d3375bf8253770ff3aa3