Bug 376930

Summary: Cannot write metadata to TIFF files
Product: [Applications] digikam Reporter: sharpknight6
Component: Metadata-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 5.4.0   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In: 7.3.0

Description sharpknight6 2017-02-25 20:08:57 UTC
When trying to write metadata to a TIFF file, the metadata is not actually written and an error with Exiv2 occurs in the console window.

One possible way to reproduce:
1) In the thumbnails view, select an image.
2) Click on "Item", followed by "Write Metadata to Image".

This happened using the AppImage bundle of version 5.4.0.

Console output resulting from executing reproduce steps (note that I replaced the file path and name with a placeholder):
digikam.general: Using  2  CPU core to run threads
digikam.general: Action Thread run  1  new jobs
digikam.metaengine: "<file path>"  ==> Title:  QMap(("x-default", CaptionValues::caption: "Test title", CaptionValues::author: "", CaptionValues::date: QDateTime( Qt::TimeSpec(LocalTime)) ) ) 
digikam.metaengine: "<file path>"  ==> Comment:  QMap()
digikam.metaengine: "<file path>"  ==> Pick Label:  0
digikam.metaengine: "<file path>"  ==> Color Label:  0
digikam.metaengine: "<file path>"  ==> Rating: +++++++++++ 4
digikam.general: Writting tags
digikam.general: Delete all keywords
digikam.metaengine: xmlACDSee "<Categories></Categories>"
digikam.metaengine: "<file path>"  ==> Read Iptc Keywords:  ()
digikam.metaengine: "<file path>"  ==> New Iptc Keywords:  ()
digikam.metaengine: MetaEngine::metadataWritingMode 0
digikam.metaengine: Will write Metadata to file "<file path>"
digikam.metaengine: wroteComment:  false
digikam.metaengine: wroteEXIF:  true
digikam.metaengine: wroteIPTC:  true
digikam.metaengine: wroteXMP:  true
digikam.metaengine: Cannot save metadata using Exiv2   (Error # 2 :  <file path>: Call to `mmap' failed: Invalid argument (errno = 22)
digikam.metaengine: Metadata for file "<file name>" written to file.
digikam.general: One job is done
digikam.general: List of Pending Jobs is empty
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Cancel Main Thread
digikam.general: Cancel Main Thread
Comment 1 caulier.gilles 2017-02-25 20:37:53 UTC
The mmap problem is an internal error from Exiv2. Report this problem as Upstream to Exiv2 bugzilla with relevant TIFF file attached to reproduce the problem.

Gilles Caulier
Comment 2 caulier.gilles 2021-04-25 08:38:22 UTC
Problem is no longer reproducible with digiKam 7.3.0 and Exiv2 0.27.4