PhotoLab 8 and XMP keywords?

PhotoLab can, of course, read XMP sidecar files created with Lightroom. Unfortunately, it reads ALL the keyword data there. Here’s a snippet of the XMP file for one image:

<dc:subject>
    <rdf:Bag>
     <rdf:li>Andy Lee</rdf:li>
     <rdf:li>Friends</rdf:li>
     <rdf:li>Halloween</rdf:li>
     <rdf:li>Lee</rdf:li>
     <rdf:li>Seleta Lee</rdf:li>
     <rdf:li>When (Events)</rdf:li>
     <rdf:li>Who</rdf:li>
    </rdf:Bag>
</dc:subject>
<lr:hierarchicalSubject>
    <rdf:Bag>
     <rdf:li>Andy Lee</rdf:li>
     <rdf:li>Friends</rdf:li>
     <rdf:li>Halloween</rdf:li>
     <rdf:li>Lee</rdf:li>
     <rdf:li>Seleta Lee</rdf:li>
     <rdf:li>When (Events)</rdf:li>
     <rdf:li>When (Events)|Halloween</rdf:li>
     <rdf:li>Who</rdf:li>
     <rdf:li>Who|Friends|Lee|Andy Lee</rdf:li>
     <rdf:li>Who|Friends|Lee|Seleta Lee</rdf:li>
    </rdf:Bag>
</lr:hierarchicalSubject>

The result is PhotoLab showing each entry as it’s own keyword, but not recognizing the hierarchical keyword structure such as Who|Friends|Lee|Andy Lee.

If I really want to move from Lightroom to PhotoLab (and I think I do), it’s going to be a long process cleaning up the keywords on all my images (I use keywords on most of them). It might even be better to delete all the keyords and start over.

Is anyone here aware of a way to shortcut that process?

In the settings there are options concerning the hierarchy of keywords, it may help you.

Have you looked at the keyword list?

PhotoLab reads the hierarchy, even though Lightroom has changed how it writes them to .xmp files. I pasted your keywords in the appropriate places in xmp and got this in PhotoLab 8 after updating metadata manually (via the “S” badge in the upper RH corner of the thumbnail.

Note that I’m on Mac.

Yes. I get exactly that - a big mess of duplicate keywords. Some at the ‘top level,’ some with partial hierarchy.

I have my settings like this:

It doesn’t seem to be helping.

Better check what Lightroom shows as keywords. You might need to clean up the mess where it originates. As noted above, Lightroom has changed how keywords are recorded in .xmp files. Some of what you see is from earlier versions, some might be the consequence of starting with flat keywords and building a hierarchy later. Such changes should be done in the keyword list. Even though reorganising a keyword list isn’t fun, it might pay in the longer run, after all, it’s the source and starting point.

As of now, Lightroom has better tools for keyword management than PhotoLab. Another reason to clean up the source.

Lightroom doesn’t show the mess.

@bobrocke

I’ve experimented with PL’s use of keywords only. They appear to interpret the lr:heirarchicalsubject entries differently than LR.

Every line in the lr:heirarchicalsubject group are treated as a separate keyword entry into the PL database.

In this example, “Andy Lee” is treated as its own entry, unique and separate from the lower entry of “Who|Friends|Lee|Andy Lee”. Same for “Halloween” and “When (events)|Halloween”.

When PL sees the “|” it knows to separate these items into a hierarchy.
PL does not know or try to place the unique entry of “Andy Lee” into the “Lee<Friends<Who” heirarchical structure. Each instance of “Andy Lee” is at a different level in the hierarchy.

You can test/demonstrate this by manually entering each line in this lr:heirarchicalsubject group into a test photo and or the .xmp file. You get the exact result you see in PL. You can also manually edit your.xmp file and see what changes in PL.
Don’t forget to toggle the little blue hierarchy symbol in the keyword palette on/off to see how the results are shown differently (show hierarchy or show flat). Also note that there is a Settings toggle to ensure PL writes the hierarchyt to the database.

In my case of “USA>New York>New York” PL’s search seems to parse it properly showing both “New York (USA)” and “New York (New York)” as search results. But when writing dc:subject keywords it only shows one instance of New York. This seems in consistent.

I don’t know if LR has alternatives for exporting keywords, but you may be able to write a separate routine to test each .xmp for standalone keywords that should already be included in a hierarchical keyword and then delete the extra entry before bringing into PL. (test, test, test!).

Good luck!

Thanks for taking the time to experiment with this. I’ll do more work with both Lightroom and PhotoLab searching for a way around the problem.

I was heavily involved in the beta testing of when DxO introduced keywords - I think it was PL5.

Anyhow, at the same time, I was writing my own image browser, which managed keywords. The main problem that DxO had problems resolving was which metadata tags should be used to be the most compatible with the majority of other DAM apps.

My app has a separate keyword management window, allowing me to organise hierarchies without having to mess around in the very small editing field the PL provides.

Here you can see a small hierarchy that I can apply to an image…

In the image browser, I can select either a whole or part of a hierarchy…

This then gets recorded in the XMP sidecar as…

  <dc:subject>
   <rdf:Bag>
    <rdf:li>Fruit</rdf:li>
    <rdf:li>Orange</rdf:li>
    <rdf:li>Satsuma</rdf:li>
   </rdf:Bag>
  </dc:subject>
  …
  <lr:hierarchicalSubject>
   <rdf:Bag>
    <rdf:li>Fruit</rdf:li>
    <rdf:li>Fruit|Orange</rdf:li>
    <rdf:li>Fruit|Orange|Satsuma</rdf:li>
   </rdf:Bag>
  </lr:hierarchicalSubject>

The rules state that all components of a hierarchy must be written, separately, to the dc;subject tag, along with any other standalone keywords.

Then the lr:hierarchicalSubject tag should contain the full “paths” of all levels in the hierarchy, delimited by |

My app only displays the individual keywords…

… but this is simply a space saver and, as you saw previously, the keyword manager allows you to see them in their context.

PhotoLab sort of mushes this up into a very small workspace, where the only option to building hierarchies is to drag one word up or down the list - hardly enjoyable when the source and target words are at either end of the alphabet.

My manager allows the user to drag words from the right list to a prospective parent in the left list - much easier.

If I now open the image I just keyworded in PL8, this is what I see…

Notice the “hierarchy” list only show the hierarchies used for this particular image.

And, in the DOP file, it is written as one list…

			Keywords = {
				{
					"Fruit",
					"Orange",
					"Satsuma",
				},
				{
					"Fruit",
				},
				{
					"Fruit",
					"Orange",
				},
			},

Personally, I find this weird but, since I don’t have to unravel it myself, I’ll leave well alone and rely on the XMP sidecar.

Here is what PL8 writes to the XMP sidecar, given the same hierarchical structure…

         <dc:subject>
            <rdf:Bag>
               <rdf:li>Fruit</rdf:li>
               <rdf:li>Orange</rdf:li>
               <rdf:li>Satsuma</rdf:li>
            </rdf:Bag>
         </dc:subject>
…
         <lr:hierarchicalSubject>
            <rdf:Bag>
               <rdf:li>Fruit</rdf:li>
               <rdf:li>Fruit|Orange</rdf:li>
               <rdf:li>Fruit|Orange|Satsuma</rdf:li>
            </rdf:Bag>
         </lr:hierarchicalSubject>

So, as long as Lightroom writes the same tags to the same keys, you should be OK. What you show in your file in your first post is perfectly reasonable and PL handles it correctly. Apart, that is, from the visual mess :wink:

So PhotoLab writes keywords to XMP files in accordance to the rules. That’s good.

But it seems to read them unusually. In my example above, PhotoLab shows the Andy Lee keyword as part of its heirarchy AND as a stand alone keyword. That seems ‘wrong.’

That is normal and is useful for when you want to search for the same keyword that happens to belong to more than one hierarchy.

I just added your example to my app and, after applying the keywords, in their hierarchies, to a file, I get the following in the XMP sidecar…

  <dc:subject>
   <rdf:Bag>
    <rdf:li>When (Events)</rdf:li>
    <rdf:li>Halloween</rdf:li>
    <rdf:li>Who</rdf:li>
    <rdf:li>Friends</rdf:li>
    <rdf:li>Lee</rdf:li>
    <rdf:li>Andy Lee</rdf:li>
    <rdf:li>Seleta Lee</rdf:li>
   </rdf:Bag>
  </dc:subject>
…
  <lr:hierarchicalSubject>
   <rdf:Bag>
    <rdf:li>When (Events)</rdf:li>
    <rdf:li>Who</rdf:li>
    <rdf:li>When (Events)|Halloween</rdf:li>
    <rdf:li>Who|Friends</rdf:li>
    <rdf:li>Who|Friends|Lee</rdf:li>
    <rdf:li>Who|Friends|Lee|Andy Lee</rdf:li>
    <rdf:li>Who|Friends|Lee|Seleta Lee</rdf:li>
   </rdf:Bag>
  </lr:hierarchicalSubject>

You can see that my hierarchicalSubject section is shorter because there is no need to list the standalone keywords there - only those that are part of a hierarchy.

You might like to research how Lr writes its hierarchies and see if you can exclude standalone words.


Addenda

Here is what I get in PL8 when I view an image with your hierarchies, as applied in my app…

And, if I press the collapse button next to the keywords field, I get a more compressed list…

Although since that is just a repeat of the keywords lit at the top of the screenshot, I’m not sure how useful that is.

Your app does a nicer job with Keywords than does PhotoLab. They should buy your intellectul property! :money_mouth_face:

In your PhotoLab view I don’t see the independent keyword Andy Lee which more how I would expect that hierarchy to be shown.

Lightroom seems to create the XMP differently from different Lightroom versions. My older images, such as _RJR9934.NEF have an older _RJR9934.NEF.xmp and a newer _RJR9934.xmp. Do you know which one PhotoLab reads?

To make matters worse, the newer XMP format does not include the <dc:subject> tag. Lightroom seems to be making everything worse.

I wish😜

I did offer but was met with silence. However, would you like to beta test my app? It is Mac only. Please DM me if you’re interested.

Can you make the two files available?

The image file name is _RJR9949.NEF.

_RJR9949.xmp is the ‘new’ format.

_RJR9949.xmp (9.1 KB)
_RJR9949.NEF.xmp (1.9 KB)

The *.nef.xmp seems to be written by darktable…

Check Lightroom’s options. Access it through ctrl-click on a keyword.

Lr only shows the bottom keywords because that is what was set in the checkboxes in the keyword list, see areas next to the upper and middle text bubbles. Export is governed by the checkboxes in the keyword options panel.

with the settings as shown, Lightroom writes the following 3 keyword related sections into the .xmp sidecar:

   <dc:subject>
    <rdf:Bag>
     <rdf:li>Aspen</rdf:li>
     <rdf:li>Grand Teton</rdf:li>
     <rdf:li>Plant</rdf:li>
     <rdf:li>States</rdf:li>
     <rdf:li>Tree</rdf:li>
     <rdf:li>USA</rdf:li>
     <rdf:li>Wyoming</rdf:li>
    </rdf:Bag>
   </dc:subject>
   <lr:weightedFlatSubject>
    <rdf:Bag>
     <rdf:li>Aspen</rdf:li>
     <rdf:li>Tree</rdf:li>
     <rdf:li>Plant</rdf:li>
     <rdf:li>Grand Teton</rdf:li>
     <rdf:li>Wyoming</rdf:li>
     <rdf:li>States</rdf:li>
     <rdf:li>USA</rdf:li>
    </rdf:Bag>
   </lr:weightedFlatSubject>
   <lr:hierarchicalSubject>
    <rdf:Bag>
     <rdf:li>Plant|Tree|Aspen</rdf:li>
     <rdf:li>USA|States|Wyoming|Grand Teton</rdf:li>
    </rdf:Bag>
   </lr:hierarchicalSubject>

PhotoLab 8 displays the following:


…which is pretty much the same thing as Lightroom.

I suppose that your keyword mixup was caused by using several apps to export to xmp

Ah! Darktable. Too many attempts to find a replacement for Lightroom.

I suppose my keywords are justing going to have to stay a mess — I’m not going to do the work necessary to clean them up, at this point.

You could export all sidecars with Lr and delete all others. You‘d have all sidecars from the same source at leadt%

Do you think PhotoLab is reading the keywords from both the Lightroom and Darktable XMPs?