Summary: | Metadata is not written back to file when size of XMP JPEG segment is larger than 65535 bytes - Use ExifTool instead Exiv2 | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | José Oliver-Didier <jose_oliver> |
Component: | Metadata-ExifTool | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 7.5.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://invent.kde.org/graphics/digikam/commit/f490d0c7b62454a4935754be87e84985f0296115 | Version Fixed In: | 8.0.0 |
Sentry Crash Report: | |||
Attachments: |
Test Image File
DebugView output log |
Created attachment 145624 [details]
DebugView output log
Hi, This problem is know and is relevant to a limitation of Exiv2 library used in background to play with metadata See the UPSTREAM bug here : https://github.com/Exiv2/exiv2/issues/1549 We don't maintain Exiv2 code. Please ask details and plan to Exiv2 team. Best Gilles Caulier I managed to add the metadata using Exiftool via the command line. The original XMP size (after performing an xmp output) for the file was 63K, close to the 65K threashold. After modifying the file the XMP size increased to 129K. Digikam seems to read the file with the large XMP ok, the problem seems to be on write operations. To accomodate this cases, could Digikam use exiftool for these cases instead? Yes, digiKam in the future will use ExifTool with specific cases not supported by Exiv2. We have already few reports about these topics. The code is not yet finalized and needs regression tests. Gilles Caulier Excellent. Good to know. Seems like the exiv2 issue has not seen much activity in a while. Apparently it was resolved in tvisitor.cpp (https://github.com/Exiv2/exiv2/issues/396) If it have been solved why this issue exist ? Good question. From https://github.com/Exiv2/exiv2/issues/396 : "tvisitor.cpp which is a stripped down version of Exiv2. It handles JPEG>64k (and BigTiff and ISOBMFF and lots of other stuff not in Exiv2)." Seems that Exiv2 has not resolved it yet. Git commit 3a672f38cda7738356f19707a6a634ca91c269e6 by Gilles Caulier. Committed on 07/04/2022 at 04:45. Pushed by cgilles into branch 'master'. Write metadata with ExifTool backend if Exiv2 fails to process, for exemple with RAW files or Video files. Tested successfuly with a MP4 video to insert a comment. For RAW and other king of files as MPO or JPEG with more than 64kB of Exif segement, Exiv2 must be bannned to uses in cases of writting operations as files can be corrupted. This require more regression tests to validate ExifTool uses in place of Exiv2. Related: bug 406540, bug 416516, bug 237504, bug 384092, bug 264210, bug 326408, bug 421464, bug 134486, bug 309341, bug 219856, bug 377622, bug 325458, bug 170693, bug 338075, bug 436876, bug 366348 M +1 -0 core/libs/metadataengine/dmetadata/dmetadata.h M +43 -0 core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp M +49 -3 core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp M +2 -2 core/libs/metadataengine/exiftool/exiftoolparser.h https://invent.kde.org/graphics/digikam/commit/3a672f38cda7738356f19707a6a634ca91c269e6 Git commit f490d0c7b62454a4935754be87e84985f0296115 by Gilles Caulier. Committed on 10/04/2022 at 03:42. Pushed by cgilles into branch 'master'. ExifTool Support: Add new option to write metadata to files using ExifTool nackend instead Exiv2. This option replace all calls to Exiv2 to patch files by ExifTool as well. This will prevent to corrupt files due to lack of stability support from Exiv2. This includes large XMP section in JPEG and MPO files. For RAW and DNG files 2 options still here but are depends of ExifTool availability. We will never write at all to DNG or RAW files with Exiv2. This new option to replace Exiv2 by ExifTool is turned off by default for the moment, but if no side-effects is discovered in the future before official 8.0.0 release, this option will be turned on by default to be safe in all cases. Related: bug 325458 FIXED-IN: 8.0.0 M +10 -8 NEWS M +1 -0 core/libs/metadataengine/dmetadata/dmetadata.cpp M +0 -63 core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp M +2 -48 core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp M +14 -4 core/libs/metadataengine/engine/metaengine.cpp M +13 -4 core/libs/metadataengine/engine/metaengine.h M +171 -30 core/libs/metadataengine/engine/metaengine_p.cpp M +9 -2 core/libs/metadataengine/engine/metaengine_p.h M +1 -1 core/libs/metadataengine/engine/metaenginesettings.cpp M +65 -59 core/libs/metadataengine/engine/metaenginesettingscontainer.cpp M +1 -0 core/libs/metadataengine/engine/metaenginesettingscontainer.h M +36 -31 core/libs/widgets/metadata/exiftool/exiftoolconfpanel.cpp M +8 -0 core/libs/widgets/metadata/exiftool/exiftoolconfpanel.h M +3 -0 core/showfoto/setup/showfotosetupmetadata.cpp M +16 -30 core/utilities/setup/metadata/setupmetadata.cpp M +2 -1 core/utilities/setup/metadata/setupmetadata.h M +48 -17 core/utilities/setup/metadata/setupmetadata_behavior.cpp M +5 -1 core/utilities/setup/metadata/setupmetadata_p.cpp M +4 -0 core/utilities/setup/metadata/setupmetadata_p.h https://invent.kde.org/graphics/digikam/commit/f490d0c7b62454a4935754be87e84985f0296115 |
Created attachment 145623 [details] Test Image File SUMMARY - After editing metadata in Digikam, metadata is not written back to the file. STEPS TO REPRODUCE 1. Open attached image file test1.jpg in Digikam 2. Edit Metadata - Add some Captions 3. Apply and write metadata to file. OBSERVED RESULT - No error and metada is NOT written back to file. EXPECTED RESULT - Metadata should be written back to file. SOFTWARE/OS VERSIONS - Windows 11 PRO - Digikam 7.5.0 (Release) ADDITIONAL INFORMATION - After running Debug View I encountered the following error message: digikam.metaengine: Cannot save metadata with Exiv2 backend: (Error # 37 : "Size of XMP JPEG segment is larger than 65535 bytes"