I have been having problems with pictures taken with iPhones (several versions, but most of my examples come from the iPhone SE and iPhone 6). Tags do not seem to be properly written to XMP, so they lose their hierarchy, or they simply aren't modified after writing them to the file. However, these tags appear in IPTC.
For some reason, this is a relatively recent problem (since digikam 7.3 maybe?), since some hierarchies seem to have been been indeed written correctly in the past.
Also, I believe that all affected pictures have a face region on them. I have attached a sample picture (2015-06-13 18.56.11.jpg) with this problem. Noticed how it contains the tags Hawaii, Honolulu, Waikiki that appear as first-level tags (which should be actually hierarchical), and an additional tag called "ASI" that is only visible in IPTC. Any attempts at modifying the tags in that picture in digikam fail. This is why I think that it can be related to bug #436286
As a workaround, I use exiftool to repair the XMP metadata, and after that point it works just fine. The command I use is: exiftool -XMP:All -TagsFromFile @ -XMP:all <file.jpg>
STEPS TO REPRODUCE
1. Select a picture taken with an iPhone and containing one face region.
2. Add some tags in a hierarchy.
3. Re-read the metadata.
The hierarchy disappears. All tags appear as first-level tags, or do not appear at all under XMP (but they do in IPTC).
Tags are written properly into the file.
Digikam 7.4 (via flatpak)
Build date: 30/11/21 10:27 (target: Debug)
Ubuntu 20.04.3 LTS
Created attachment 144132 [details]
Affected picture (2015-06-13 18.56.11.jpg)
Created attachment 144133 [details]
Screenshot of XMP metadata
Created attachment 144134 [details]
Screnshot of IPTC metadata
Yes, the cause is the same. The problem has not only existed since digiKam-7.3.0. I can also reproduce it with an old digiKam-6.4.0 AppImage. Writing XMP metadata works, just no face metadata.
digikam.metaengine: Cannot get Xmp metadata tag title with Exiv2: (Error # 35 : "No namespace info available for XMP prefix `apple-fi'"
*** This bug has been marked as a duplicate of bug 436286 ***
Git commit 1c5575647139ee20665e8b15e00ba59455c04fad by Maik Qualmann.
Committed on 02/12/2021 at 19:51.
Pushed by mqualmann into branch 'master'.
register Apple face info (apple-fi) namespace
Related: bug 436286
M +2 -2 NEWS
M +2 -0 core/libs/metadataengine/engine/metaengine.cpp