Bug 463577 - Exiv2 alters unrelated DJI Exif metadata when editing tags.
Summary: Exiv2 alters unrelated DJI Exif metadata when editing tags.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 8.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-29 05:03 UTC by spiesant
Modified: 2023-02-20 20:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments
test image (1.77 MB, image/jpeg)
2022-12-29 05:03 UTC, spiesant
Details

Note You need to log in before you can comment on or make changes to this bug.
Description spiesant 2022-12-29 05:03:01 UTC
Created attachment 154874 [details]
test image

SUMMARY
Upon using digiKam to remove a tag from a jpeg, I found that a large number of other metadata tags were altered. This includesIn particular, vendor-specific "DJI" exif tags (containing flight data from the DJI drone).

STEPS TO REPRODUCE
1. Grab the attached jpeg, and use exiftool to dump all of its metadata to a text file
2. Import the jpeg into digiKam
3. Uncheck one of its tags, i.e. "0.0.1"
4. Apply (aka write changes into the jpeg)
5. Use exiftool to again dump all of its metadata to a text file
6. Diff the results. A bunch of metadata unrelated to tags/keywords has changed - i.e. "DJI 0x000c", "DJI 0x000d", "DJI 0x0013", etc have all had their values changed.

The issue only seems to allow me to attach one file, so here's a second screenshot showing the diff: https://jiij.cc/snaps/2022-12-28_20.57.34.png

OBSERVED RESULT

Vendor-specific metadata has been altered

EXPECTED RESULT

Only metadata related to the tags should be altered; other data should not be modified/lost.

SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
Tested on the latest weekly 8.0.0-beta1 build
Comment 1 caulier.gilles 2022-12-29 07:18:00 UTC
It's probably a bug in Exiv2 metadata engine which do not deal with DJI Exif section from images.

What's happen if you use ExifTool instead Exiv2 as metadata engine in digiKam Setup/Metadata page ? Can you reproduce the dysfunction ?

https://docs.digikam.org/en/setup_application/metadata_settings.html#behavior-settings

Gilles Caulier
Comment 2 Maik Qualmann 2022-12-29 12:41:58 UTC
I can reproduce the problem. The unknown DJI tags are also changed when we write the EXV container back with ExifTool. The problem is probably already arising when reading the metadata. A test with the Exiv2 CLI tool is still pending, but will probably not bring any other result.

Maik
Comment 3 spiesant 2022-12-31 02:09:44 UTC
(In reply to caulier.gilles from comment #1)
> It's probably a bug in Exiv2 metadata engine which do not deal with DJI Exif
> section from images.
> 
> What's happen if you use ExifTool instead Exiv2 as metadata engine in
> digiKam Setup/Metadata page ? Can you reproduce the dysfunction ?
> 
> https://docs.digikam.org/en/setup_application/metadata_settings.
> html#behavior-settings
> 
> Gilles Caulier

If you're referring to checking the option "Delegate to ExifTool backend all operations to write metadata to files", then yeah, I can confirm that it's still destructive to those metadata values.
Comment 4 Maik Qualmann 2023-01-01 18:59:02 UTC
Git commit 94c5c8814a7c9f68f014ea3cfa0c88268620d585 by Maik Qualmann.
Committed on 01/01/2023 at 18:57.
Pushed by mqualmann into branch 'master'.

restore MakerNotes from the original file when using ExifTool write

M  +3    -0    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/commit/94c5c8814a7c9f68f014ea3cfa0c88268620d585
Comment 5 Maik Qualmann 2023-01-02 19:17:52 UTC
Git commit 5a6ea9ccecef30a63bbecfa662811511610d9223 by Maik Qualmann.
Committed on 02/01/2023 at 19:16.
Pushed by mqualmann into branch 'master'.

prevent deletion of tags (MPF group) when writing with ExifTool

M  +3    -1    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/commit/5a6ea9ccecef30a63bbecfa662811511610d9223
Comment 6 Maik Qualmann 2023-02-20 20:37:52 UTC
The prerequisite for not changing the Makernotes is the activated ExifTool support in digiKam-8.0.0.

Maik