Author Topic: Keywords not written to HierarchicalSubject in XMP  (Read 4510 times)

Offline rienvanham

  • Member
  • **
  • Posts: 67
    • View Profile
Keywords not written to HierarchicalSubject in XMP
« on: September 01, 2024, 10:18:56 AM »
Hello,

I have no idea if this is by design or a bug:
I'm (only) using the hierarchical keywordslist to add keywords to my images. Some keywords in the root don't have child-keywords. If I add a keyword to an image which has already some keywords, the new one is added. BUT: I see in the "HierarchicalSubject" tag (XMP-lr) that all keywords (from the root of my list with no children) are removed from this tag!

e.g. existing values in this tag:
2024*Duitsland|Deutschland|Noordrijn-Westfalen|Nordrhein-Westfalen|Niederkrüchten*Fietsvakantie|Drie Landen Toer
And I add a keyword (e.g. Apparaten | Actioncam | GoPro) then the tag consist of:
Duitsland|Deutschland|Noordrijn-Westfalen|Nordrhein-Westfalen|Niederkrüchten*Fietsvakantie|Drie Landen Toer*Apparaten|Actioncam|GoPro

and "2024" is gone!

This has an impact on applications that read/uses this tag.

Am I overseeing something?

Thanks in advance,

Rien.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #1 on: September 03, 2024, 11:25:19 AM »
Rien,

What purpose does the asterisk serve?

Can you share either an XMP sidecar file before and after the change, or an image with embedded XMP before and after the change so that I can investigate?

Use the 'Attachments and other options' link when you're composing your reply to this message and there you'll be able to upload your JPEG format screenshot.

Thanks,

-Kirk

Offline rienvanham

  • Member
  • **
  • Posts: 67
    • View Profile
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #2 on: September 04, 2024, 02:01:37 AM »
Hi Kirk,

The "asterisk" is just the devider for the keywords.
it's only the tag XMP-lr/HierarchicalSubject

I've upload 2 files:
1: 20240718_123011 - Drie Landen Toer Origineel.JPG (original)

XMP-lr/HierarchicalSubject:
België|Wallonie|Bütgenbach|Am Breitenbach*Fietsvakantie|Drie Landen Toer*2024*Bankje*Plaatsnaambord
Thus keywords:
België|Wallonie|Bütgenbach|Am Breitenbach
Fietsvakantie|Drie Landen Toer
2024
Bankje
Plaatsnaambord

2: 20240718_123011 - Drie Landen Toer Photo Mechanic.JPG (modified by Photo Mechanic)
Added the keyword Apparaten|Actioncam|GoPro

XMP-lr/HierarchicalSubject:
België|Wallonie|Bütgenbach|Am Breitenbach*Fietsvakantie|Drie Landen Toer*Apparaten|Actioncam|GoPro
Thus keywords:
België|Wallonie|Bütgenbach|Am Breitenbach
Fietsvakantie|Drie Landen Toer
Apparaten|Actioncam|GoPro

And
2024
Bankje
Plaatsnaambord
(keywords without children) are gone!

Thanks on forehand,
Regards,
Rien

Offline rienvanham

  • Member
  • **
  • Posts: 67
    • View Profile
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #3 on: September 04, 2024, 10:03:44 AM »
Addition:
It also happens when I put only a crop on the image (or change it's position/size) then also the "single" keywords are lost!

Thanks in advance,

Rien.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #4 on: September 04, 2024, 10:24:49 AM »
Rien,

Addition:
It also happens when I put only a crop on the image (or change it's position/size) then also the "single" keywords are lost!

I expect that it will happen when any metadata update occurs.  I'm looking into it today.  Thank you for the sample files.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #5 on: September 09, 2024, 01:52:39 PM »
Rien,

I have no idea if this is by design or a bug:
I'm (only) using the hierarchical keywords list to add keywords to my images. Some keywords in the root don't have child-keywords. If I add a keyword to an image which has already some keywords, the new one is added. BUT: I see in the "HierarchicalSubject" tag (XMP-lr) that all keywords (from the root of my list with no children) are removed from this tag!

e.g. existing values in this tag:
2024*Duitsland|Deutschland|Noordrijn-Westfalen|Nordrhein-Westfalen|Niederkrüchten*Fietsvakantie|Drie Landen Toer
And I add a keyword (e.g. Apparaten | Actioncam | GoPro) then the tag consist of:
Duitsland|Deutschland|Noordrijn-Westfalen|Nordrhein-Westfalen|Niederkrüchten*Fietsvakantie|Drie Landen Toer*Apparaten|Actioncam|GoPro

and "2024" is gone!

This has an impact on applications that read/uses this tag.

Am I overseeing something?

I was able to investigate the issue.  There is only one Keywords field in PM at this time, so both flat keywords and hierarchical keywords are placed in the same field in the Metadata (IPTC) Info window.  When it comes time to save them to the XMP data, the keywords are parsed, and hierarchical keywords (those that consist of two or more keywords separated by '|') are written to the HierarchicalSubject field in the XMP-lr namespace, and keywords that are flat are written to the non-hierarchical keywords field.

It doesn't matter if the keywords came from the Structured Keywords panel or not if they resemble flat keywords.  They are flat keywords.

You could make your '2024' be a child of a 'Years' tree (create a Years item at root and put 2024 there), and do the same for those other keywords that you have at the root of your Structured Keywords panel.  Then they will be treated as hierarchical.

To truly solve this problem, and to allow you to have childless hierarchical keywords that function as you desire, PM would have to offer another editable field just for hierarchical keywords that would be maintained separately from the standard keywords field.

-Kirk

Offline rienvanham

  • Member
  • **
  • Posts: 67
    • View Profile
Re: Keywords not written to HierarchicalSubject in XMP
« Reply #6 on: September 10, 2024, 05:29:36 AM »
Hi Kirk,

Thanks for your investigation! Strange that other software (I'm also using iMatch) have no problems with writing "childless" keywords to this tag. But I can live with it!

In the past days I did what you suggested: "2024" (and all other years) are moved to "Jaar|[year]" (year) and some other keywords (I don't have much of them with no children) are moved to "overig|[keyword]" (misc).

So now there is no "miscommunication" between PMP and iMatch.

Greetings,
Rien.