Bug 498391

Summary: hierarchical tags disappear
Product: [Applications] digikam Reporter: fch22 <frederic.chaume>
Component: Metadata-ExifToolAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 8.5.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.6.0
Sentry Crash Report:
Attachments: XMP metadata for DNG file
metadata from exif tool for DNG
exiftool : initial metadata
initial XMP metadata
exiftool : final metadata
XMP final metadata
jpeg generated from DXO
metadata settings
assoicated XMP sidecar file

Description fch22 2025-01-08 17:57:33 UTC
Created attachment 177203 [details]
XMP metadata for DNG file

here is my problem:
I'm using hierarchical tags on Raw files and using XMP sidecar files. I have attached the exiftool and XMP metadata (from metadata menu) (DJI_0819-DNG-exiftool-initial and DJI_0819-DNG-XMP-initial files)
I'm generating a Jpeg from DXO
I'm getting both tags in hierarchical and flat format. See attached the exiftool and XMP metadata (from metadata menu) (DJI_0819-exiftool-initial and DJI_0819-XMP-initial) files
then I'm removing the tags which are presented as flat, and once running metadata synchronization, hierarchical tags are disappearing and only flat tags are visible.
Tags only visible in the XPKeywords in the exiftool section 
See attached the exiftool and XMP metadata (from metadata menu) ((DJI_0819-exiftool-final and DJI_0819-XMP-finall)) files

when I compare initial and final exiftools and XMP metadatas I found lots of difference, and seems lots information are disappearing (for example I see that HyperfocalDistance : has been changed from 2.19 to 2.20 m)
Comment 1 fch22 2025-01-08 17:58:18 UTC
Created attachment 177204 [details]
metadata from exif tool for DNG
Comment 2 fch22 2025-01-08 17:58:54 UTC
Created attachment 177205 [details]
exiftool : initial metadata
Comment 3 fch22 2025-01-08 17:59:21 UTC
Created attachment 177206 [details]
initial XMP metadata
Comment 4 fch22 2025-01-08 17:59:47 UTC
Created attachment 177207 [details]
exiftool : final metadata
Comment 5 fch22 2025-01-08 18:00:10 UTC
Created attachment 177208 [details]
XMP final metadata
Comment 6 Maik Qualmann 2025-01-08 18:29:08 UTC
Sorry, should I really compare all this text metadata somehow - no? Why not just upload a sample file?

We don't know anything about your metadata settings, whether you read and write with ExifTool yes/no, etc. And yes, ExifTool can also recalculate or round metadata.

Maik
Comment 7 Maik Qualmann 2025-01-08 18:42:17 UTC
Please try the current pre-release digikam-8.6.0 version. Your image seems to contain a "plus_1_ " XMP namespace, which we only added for digiKam-8.6.0, because Exiv2 does not know about it and then ignores XMP metadata.

https://files.kde.org/digikam/

Maik
Comment 8 fch22 2025-01-09 08:21:13 UTC
(In reply to Maik Qualmann from comment #6)
> Sorry, should I really compare all this text metadata somehow - no? Why not
> just upload a sample file?
> 
> We don't know anything about your metadata settings, whether you read and
> write with ExifTool yes/no, etc. And yes, ExifTool can also recalculate or
> round metadata.
> 
> Maik

Ok understood, so here is the JPG which is just generated from DXO. scenario to reproduce the problem is just to unset "flat" tags. Consequence is most of the hierarchical tags are disepearring and "flat" tags are coming back
Comment 9 fch22 2025-01-09 08:25:30 UTC
Created attachment 177220 [details]
jpeg generated from DXO
Comment 10 fch22 2025-01-09 08:41:06 UTC
(In reply to Maik Qualmann from comment #7)
> Please try the current pre-release digikam-8.6.0 version. Your image seems
> to contain a "plus_1_ " XMP namespace, which we only added for
> digiKam-8.6.0, because Exiv2 does not know about it and then ignores XMP
> metadata.
> 
> https://files.kde.org/digikam/
> 
> Maik

ok, effectively I found this namespace in the DNG, but seems the problem is not present in each and any raw file. 
In any way I will test 8.6 and also check with DxO explanation about this namespace

By the way I have configured DK to use  exiftool.exe 12.89, no exiv2, see attach the metadata settings
Comment 11 fch22 2025-01-09 08:41:30 UTC
Created attachment 177221 [details]
metadata settings
Comment 12 fch22 2025-01-09 09:03:51 UTC
(In reply to fch22 from comment #10)
> (In reply to Maik Qualmann from comment #7)
> > Please try the current pre-release digikam-8.6.0 version. Your image seems
> > to contain a "plus_1_ " XMP namespace, which we only added for
> > digiKam-8.6.0, because Exiv2 does not know about it and then ignores XMP
> > metadata.
> > 
> > https://files.kde.org/digikam/
> > 
> > Maik
> 
> ok, effectively I found this namespace in the DNG, but seems the problem is
> not present in each and any raw file. 
> In any way I will test 8.6 and also check with DxO explanation about this
> namespace
> 
> By the way I have configured DK to use  exiftool.exe 12.89, no exiv2, see
> attach the metadata settings

just checked the XMP (and attached also) , here is the exact namespace found
 <plus_1__1_:ImageCreator>
            <rdf:Seq>
               <rdf:li rdf:parseType="Resource">
                  <plus_1__1_:ImageCreatorName>Chaume Frédéric</plus_1__1_:ImageCreatorName>
               </rdf:li>
            </rdf:Seq>
         </plus_1__1_:ImageCreator>
Comment 13 fch22 2025-01-09 09:04:34 UTC
Created attachment 177223 [details]
assoicated XMP sidecar file
Comment 14 fch22 2025-01-09 09:20:10 UTC
(In reply to fch22 from comment #10)
> (In reply to Maik Qualmann from comment #7)
> > Please try the current pre-release digikam-8.6.0 version. Your image seems
> > to contain a "plus_1_ " XMP namespace, which we only added for
> > digiKam-8.6.0, because Exiv2 does not know about it and then ignores XMP
> > metadata.
> > 
> > https://files.kde.org/digikam/
> > 
> > Maik
> 
> ok, effectively I found this namespace in the DNG, but seems the problem is
> not present in each and any raw file. 
> In any way I will test 8.6 and also check with DxO explanation about this
> namespace
> 
> By the way I have configured DK to use  exiftool.exe 12.89, no exiv2, see
> attach the metadata settings
(In reply to fch22 from comment #12)
> (In reply to fch22 from comment #10)
> > (In reply to Maik Qualmann from comment #7)
> > > Please try the current pre-release digikam-8.6.0 version. Your image seems
> > > to contain a "plus_1_ " XMP namespace, which we only added for
> > > digiKam-8.6.0, because Exiv2 does not know about it and then ignores XMP
> > > metadata.
> > > 
> > > https://files.kde.org/digikam/
> > > 
> > > Maik
> > 
> > ok, effectively I found this namespace in the DNG, but seems the problem is
> > not present in each and any raw file. 
> > In any way I will test 8.6 and also check with DxO explanation about this
> > namespace
> > 
> > By the way I have configured DK to use  exiftool.exe 12.89, no exiv2, see
> > attach the metadata settings
> 
> just checked the XMP (and attached also) , here is the exact namespace found
>  <plus_1__1_:ImageCreator>
>             <rdf:Seq>
>                <rdf:li rdf:parseType="Resource">
>                   <plus_1__1_:ImageCreatorName>Chaume
> Frédéric</plus_1__1_:ImageCreatorName>
>                </rdf:li>
>             </rdf:Seq>
>          </plus_1__1_:ImageCreator>


Also notice that in some XMP files I find such declaration, but not in all XMP
            xmlns:plus_1__1_="http://ns.useplus.org/ldf/xmp/1.0/ImageCreator/"
            xmlns:plus_1_="http://ns.useplus.org/ldf/xmp/1.0/ImageCreator"

If this can help
Nervertheless after remonving the namspace from the XMP, problem is fixed. 
I will test also 8.6 and let you know the result
Comment 15 fch22 2025-01-09 10:49:30 UTC
I tested the problem on another PC where DK8.4 was running. 
Using the same jpg file , tags are correctly presented (only hierarchical ones , not flat ones) and I checked that namespace "plus_1_" was also present 
then I installed the 8.6 pre-release and I see the same correct behavior

Does it mean  it is  a problem introduced by 8.5 ?

regards
frederic
Comment 16 Maik Qualmann 2025-01-09 20:46:02 UTC
Git commit 3995000b092163e4773dad3946fba49864d57e3d by Maik Qualmann.
Committed on 09/01/2025 at 20:45.
Pushed by mqualmann into branch 'master'.

add namespace for "plus_1_" to avoid Exiv2 error exception
FIXED-IN: 8.6.0

M  +1    -1    NEWS
M  +15   -12   core/libs/metadataengine/engine/metaengine.cpp

https://invent.kde.org/graphics/digikam/-/commit/3995000b092163e4773dad3946fba49864d57e3d