PhotoLab Keyword Tools

Summary

I’ve written several tools that add features to Photolab 8, and I’m providing these tools here.

  • importKeywords – Add keywords by importing from a text file.

  • exportKeywords – Export the current keyword structure to to a text file.

  • renameKeywords – Rename, move, and merge keywords.

  • findKeywordMatches – Find images matching logical expressions that can include AND, OR, and NOT operators.

PhotoLabTools-win.zip (36.3 MB)

I will update this OP so that it always points to the latest versions of my tools.

Target Audience

  • These tools only work for Windows users. While I can create versions that run on a Mac, I don’t have a Mac for testing. If you’d like to help develop Mac versions, contact me.

  • The tools are for people who use Photolab as their primary keywording tool. If you do your keyword tagging in some other tool, my tools may be of limited use.

Details

While I include a bit more details on the tools here, the tools come with a lot of options. The ZIP file containing the tools contains detailed documentation.

Some of these tools directly modify the Photolab database. You should exit Photolab and create a backup database before running those.

These tools are based on requests made for these features over the years. I’ve included pointers to some of these.

exportKeywords exports keywords in 3 formats: raw, Adobe, and HTML. The Adobe format should work with Adobe Bridge. Some other keywording tools use extended versions of the Adobe Bridge format, which included features that Photolab doesn’t support (categories, synonyms). You might be able to go from Photolab to one of these other tools, but not necessarily the other way.

importKeywords will modify the Photolab database to add keywords. It supports raw and Adobe Bridge formats. Existing keywords will be unaffected—the tool only adds keywords that don’t currently exist.

renameKeywords can rename a keyword, but it can also move it, and will merge keywords with the same name. If a keyword is being merged and has children, the children will themselves be either moved or merged depending on whether the matching child exists or not.

I saw a request for this feature recently, but can’t find it right now. I’ve wanted this tool for a while, and finally ran into a case where I really needed it, so I went ahead and wrote it.

findKeywordMatches can find images that match logical expressions (ones formed using ANDs, ORs, and NOTs). There is some pattern matching available. The pattern “^$” will match all images that have no keywords. The tool can search through all your indexed images, or just indexed images in one or more folders. The results can be output as a text or HTML file, or used to create a Photolab project. If you choose the HTML option, the tool will look for existing previews and thumbnails stored in Photolab’s cache folder.

Unlike external keyword tools with their own databases, findKeywordMatches can find keywords assigned to Photolab images, whether master copies or virtual copies. It will identify virtual copies in the generated results.

Here is a sample of the output. The first is the results of a keyword search as a project. The second is the same search, but stored in an HTML file.

Do you have DxO’s permission to use their trademark name?

Unfortunately, @Joanna, it looks like you didn’t do any research before posting your question.

I can’t find any evidence that DxO holds the trademark to the word “PhotoLab”. It claims trademarks only for “DxO” and “DxO Labs” (see their “legal” page).

“PHOTOLAB” is a trademark of London Drugs Limited, but that seems irrelevant. DxO uses the word PhotoLab without acknowledging this trademark (I searched through the PhotoLab 9 User Guide for all references to the word “trademark” and there is no mention of London Drugs) , so I assume I can as well. If London Drugs contacts me, then I’ll worry about making a change.

There are so many examples in commercial software, let alone freeware, video tutorials, written tutorials, etc., by which one might gauge whether or not this constitutes fair use (particularly, nominative fair use). I suspect fair use applies here, but admit it’s too murky a subject for me to be sure about.

Is “Keyword Tools for Photolab” better?

Interesting, but you implemented these as compiled executables, so there’s no way to review your work. I’m on a Mac and would be really curious to see how you did this.

I don’t plan to change the name at this time. PhotoLab is not a trademark owned by DxO.

Some clues for how this is done are at https://forum.dxo.com/t/some-database-querying-tools-that-you-might-find-useful/50526.

If you’d like Mac versions of the tools, and have experience with databases, send me a message. I need to have some of the Mac database fields reverse-engineered.

In general:

  • importKeywords and exportKeywords work by reading from and writing to the Keywords table. The getKeywordPaths SQL at the link above will give you an idea of how to read from the Keywords table (and there is a Mac version!)
  • renameKeywords is a more complicated story. As I said in the OP, I had to consider 16 different cases involving renaming, reparenting, and merging. This means that I have to both alter the Keywords table and the KeywordsItems table.
  • findKeywordMatches creates SQL to generate a giant table of all image-to-keyword pairs. The SQL for findImagesWithoutKeywords at the link above will give you a clue to how the query is done. The logical expression given to the tool is parsed and broken down into SQL queries which extract records from the giant table I mentioned and use INTERSECT, UNION, and EXCEPT to support AND, OR, and NOT. The pattern matching is done with the SQL “LIKE” operator.

If you think looking at the code would be a quick path to getting working Mac versions, understand that I can generate Mac versions—it’s just that they would then try to operate on a database with Windows table names and fields, which will not work. You’d still have to reverse-engineer the Mac database fields, and if you can do that, I can generate Mac versions.