Bug 379918

Summary: Digikam writing tags in wrong order
Product: [Applications] digikam Reporter: Sebas <djsebas>
Component: Tags-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: caulier.gilles, freisim93
Priority: NOR    
Version: 5.5.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.6.0

Description Sebas 2017-05-16 21:33:38 UTC
1. Digikam is not writing tags in A-Z order.
2. Also it is not writing tags in the order as selected by user.

So what order does it use and why?
Won't option 1 or 2 not be a better idea?
Comment 1 Simon 2017-06-05 16:26:54 UTC
I assume there is no specific order enforced by digiKam or exiv2 (library used to write metadata). I don't directly see a reason why these should be ordered in the first place, I think that should be up to the software displaying the tags. And as far as I know no specification (exiv, iptc or xmp) says anything about ordering keywords.
What is your use case for having them ordered?
Comment 2 Simon 2017-06-05 16:27:32 UTC
see above
Comment 3 Sebas 2017-06-05 18:20:42 UTC
In version 5.6.0 I can not reproduce this problem.

This is what I believe after a little digging:

The software displaying the tags (Windows Explorer) reports IPTC Keywords first, then EXIF XPKeyworks. What I see in 5.6.0 is that existing EXIF XPKeywords are written to IPTC Keywords when modifying tags.

For example when the EXIF XPKeyworks field contains 'A,' and the tag 'Z' is added, then 'A; Z' is written to IPTC Keywords. Then the software displaying the tags reads 'A; Z' from IPTC Keywords and then 'A' from EXIF XPKeyworks. Obviously the latter is being displayed already, thus ignored.

Status changed to resolved + invalid for now.