Bug 473534 - Metadata tags not written to HEIF files
Summary: Metadata tags not written to HEIF files
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (other bugs)
Version First Reported In: 8.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-19 14:16 UTC by caro23
Modified: 2023-08-20 19:05 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description caro23 2023-08-19 14:16:01 UTC
SUMMARY
Tags are not written to HEIF files if enabled in settings (not to exif, iptc, or xmp).
This works fine with the same setup using JPEG files.

STEPS TO REPRODUCE
1. Enable writing of image tags (Settings > configure digiKam > Metadata > Behaviour > Check "Image Tags")
2. Assign a tag to a HEIF file
3. Write to file (Item > Write Metadata to File)

OBSERVED RESULT
No metadata written.

EXPECTED RESULT
metadata written to exif, iptc, and xmp - same as for jpeg

SOFTWARE/OS VERSIONS
Windows: Windows 11 22H2

ADDITIONAL INFORMATION
[10720] digikam.metaengine: Loading metadata with "Exiv2" backend from "C:/img/test1.heic"
[10720] digikam.general: Writing tags
[10720] digikam.general: One job is done
[10720] digikam.general: -------------------------- New Keywords ("Wien")
[10720] digikam.metaengine: "C:/img/test1.heic"  ==> New Iptc Keywords:  ("Wien")
[10720] digikam.metaengine: MetaEngine::metadataWritingMode 0
[10720] digikam.general: One job is done
[10720] digikam.metaengine: Will write Metadata to file "C:/img/test1.heic"
[10720] digikam.general: One job is done
[10720] digikam.general: One job is done
[10720] digikam.metaengine: wroteComment:  false
[10720] digikam.metaengine: wroteEXIF:  false
[10720] digikam.metaengine: wroteIPTC:  false
[10720] digikam.metaengine: wroteXMP:  false
[10720] digikam.metaengine: Writing metadata is not supported for file "test1.heic"
[10720] digikam.metaengine: ExifTool "Load Metadata" "-json -G:0:1:2:4:6 -l C:\\img\\test1.heic"
[10720] digikam.metaengine: Loading metadata with "Exiv2" backend from "C:/img/test1.heic"
[10720] digikam.general: Metadata loading with Exiv2 took 1 ms ( true )
[10720] digikam.general: "Standard Exif Tags" decoding took 0 ms ( false )
[10720] digikam.general: "MakerNote Exif Tags" decoding took 0 ms ( false )
[10720] digikam.general: "IPTC Records" decoding took 0 ms ( true )
[10720] digikam.general: "XMP Schema" decoding took 0 ms ( true )
[10720] digikam.general: One job is done
[10720] digikam.general: List of Pending Jobs is empty
[10720] digikam.general: Event is dispatched through a passive pop-up
[10720] QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
[10720] digikam.general: Cancel Main Thread
[10720] digikam.general: Finish Main Thread
[10720] digikam.metaengine: ExifToolProcess::readOutput(): ExifTool command completed
[10720] digikam.metaengine: ExifTool complete command for action "Load Metadata" with elasped time (ms): 20
[10720] digikam.metaengine: ExifTool Json map size: 177
[10720] digikam.metaengine: ExifTool parsed command for action "Load Metadata" 157 properties decoded
[10720] digikam.metaengine: ExifTool complete "Load Metadata" for "C:/img/test1.heic"
Comment 1 Maik Qualmann 2023-08-19 14:28:46 UTC
Our main metadata engine is Exiv2, but this is limited to read only in HEIF.
To write metadata to HEIF images, go to the digiKam setup under Metadata and enable writing with ExifTool.
Now metadata in Exif and XMP can be written in HEIF images. Note that when you interact with Windows Explorer, it writes the metadata into a QuickTime container, which in principle would be possible with ExifTool, but we don't support it at the moment. We already have a bug report for this.

Maik
Comment 2 caro23 2023-08-20 07:11:32 UTC
(In reply to Maik Qualmann from comment #1)
> Our main metadata engine is Exiv2, but this is limited to read only in HEIF.
> To write metadata to HEIF images, go to the digiKam setup under Metadata and
> enable writing with ExifTool.
> Now metadata in Exif and XMP can be written in HEIF images. Note that when
> you interact with Windows Explorer, it writes the metadata into a QuickTime
> container, which in principle would be possible with ExifTool, but we don't
> support it at the moment. We already have a bug report for this.
> 
> Maik

Thanks, Maik. I haven't found any related bug.
This works although I see some differences in the tags written by ExifTool (which is no surprise). More and more mobile phones support HEIF, or even suggest it as the standard option. Therefore, full HEIF support would be great.
Comment 3 Maik Qualmann 2023-08-20 07:25:23 UTC
It's about Bug 469408, although it's about video files. Windows Explorer also writes metadata in video files in a QuickTime container.
What difference do you see when writing tags with ExifTool? Note that you can specify which tags should be written or read in the advanced digiKam metadata settings.

Maik
Comment 4 caro23 2023-08-20 11:32:27 UTC
(In reply to Maik Qualmann from comment #3)
> It's about Bug 469408, although it's about video files. Windows Explorer
> also writes metadata in video files in a QuickTime container.
> What difference do you see when writing tags with ExifTool? Note that you
> can specify which tags should be written or read in the advanced digiKam
> metadata settings.
> 
> Maik

Hm... I can only compare for JPEG obviously. However, since you asked for it, I investigated it:

I have activated write metadata for tags and person tags. The reason is that I want to make this indexable by online services such as Onedrive or Google Photos.
I checked the metadata for the JPEG file. The main difference is the sorting of tags (which doesn't matter) and the XPKeywords tag.

						ExifTool	Exifv2
EXIF
	XPKeywords			Y			N
IPTC
	Keywords			Y			Y
XMP
	CatalogSets			Y			Y
	Categories			Y			Y
	HierarchicalSubject	Y			Y
	LastKeywordXMP		Y			Y
	Region*				Y			Y
	Subject				Y			Y
	TagList				Y			Y

For HEIF, ExifTool writes the same info.
Comment 5 Maik Qualmann 2023-08-20 19:05:30 UTC
Writing XP* tags is another long story. Exiv2 can only read XP*, not write it. Due to the text encoding by Microsoft. XP* tags should no longer be used in modern times.

Maik