Lightroom Keywords not exporting to JPEG
Alamy is one of the sites I upload to, and I’ve been bemused for a time when I’m adding some main keywords that major keywords seem to be missing. My recent trip to Kauai brought this home as the keyword “kauai” was missing on the uploaded files. At first I thought I had forgotten to add it, but it was there in Lightroom, as “Kauai”. At first, I thought this was the reason, but no, there is a deeper reason. This post has developed into two distinct activities as my understanding deepened. The first is how you change a keyword, say from capitalized to lower case, and the second is how you identify a deeper issue if your keywords are not showing up in the exported files. The bottom line for me (and I hope not for you) is that most of my online stock files have some missing keywords – all my Kauai shots and, even worse, I noticed that the keyword “washington” was similarly missing, and I have a lot of pictures of Washington DC! So, how to fix the problem? I haven’t come up with a way to add a new keyword to all my online files on all the stock agencies so I’ll have to check a few of them manually, but I wanted a way to stop the problem from occurring in the first place. Here is the low down on Lightroom’s treatment of keywords:
The first thing to know is that Lightroom can only hold one copy of a keyword in its database however it is capitalized. So if you have entered Kauai in the past, then all different capitalizations of that word revert to the one stored. So if I type the word in lower case, it makes no difference – it gets added to the database and file in the way it was originally entered, as “Kauai”
So, you need a way to rename all your capitalized keywords to remove the capital letter and stop the problem from re-occuring. Open Lightroom and in the Keyword List type in the word you are trying to retype – in this case Moon.
Right-click on the incorrect keyword in the list and choose “Edit Keyword Tag” in the list of options. This opens up a new window and you can change the word “Moon” to “Moontag”. This new word needs to be unique and not one that exists in the database. Click Edit. All files with “Moon” as a keyword are now renamed in the database with “Moontag”.
Now right click this new keyword tag and repeat the process, but this time renaming the file to “Moon”. To add my latest understanding of the problem, this page is also where you check each of the boxes in the pop-up screen to enable export of that particular keyword. This is an example of a keyword that is going to be exported to your JPEG – if these check boxes are blank, you need to check them to make sure the appropriate keywords are exported.
When you have finished, all files with the old keyword will now have the new one – in the database.
Now, on to the deeper issue. I found that many of the early keywords I added (probably in Lightroom 1.0) were not set to export in the screens that we looked at above. But I had no way of finding which keywords were set like that. My manual experiments convinced me that it was my earliest keywords that were at fault, which makes the problem even worse, because those early keywords are likely to be the common ones – in my case like flower, plant, tree, cloud, virginia – you get the picture!! After more research, I found that there was a bug in the updating process from Lightroom 1 to Lightroom 2 that caused all keywords to be set to “Do not export.” Adobe issued a script to fix the issue at the time (which I obviously missed), but now that we are at LR3, I don’t think I trust the script to work.
I found two ways to find the keywords in LR that have this setting – the first is the easiest one, the second has a lot more capabilities and could be used to automatically change the settings in the database if you are good with SQL!
The first approach is to export all your keywords from LR into a text file. Go to Metadata>Export Keywords and create a text file of your keywords on the Desktop. Open this in Notepad. As you scan down through the list of keywords, you will see ones that are in square brackets:
This keyword [Bird] is one that is set to “Do Not Export.” If you have Lightroom open at the same time, you can search for this keyword in the Keyword List and manually check the boxes to make it export as explained above. Continue to the end of the text file, and you will have found them all. I found about 100 keywords in this state, which was not too bad to do manually.
The second method is more interesting, and has the capability to write a script to automatically update the fields – although there is a chance that you may screw up the system if you change something that is linked elsewhere in the database! Lightroom uses an SQLite database, and so I needed a SQLite Reader. I found an easy to use open source SQLite editor at Softpedia Download this from one of the Mirror file locations shown (I’m reasonably sure this is a reliable site, but proceed at your own risk!). The download is a zip file so unzip the program to your desktop. It runs directly when opened, so there is no need to install.
Then locate your Lightroom database. This is in the location specified in Edit:Catalog Settings:General and has the extension .lrcat. Next, make a copy of this by copying to your desktop. We are going to look at this copy. You need to close Lightroom to copy it, and when you have, open Lightroom again.
Double-click on SQLite Database Browser icon and it will open
In File Open, look for the Lightroom database on the desktop. Open it, and you will see a screen like this:
Click on the second tab to browse the contents of the database. You need to select the table we are interested in. In the top row, click in the “Table” box in the top left of the tab and select “AgLibraryKeyword.” This is the table that contains keyword attributes. The screen will now look like this:
The column we are interested in is the one called “Include on Export” and any keywords where this is “0” will NOT be exported. In my case, these were all at the start of the table, which coincides with my assumption that these were early keywords, but you can also search for them by clicking the magnifying glass in the top left to open the search box. Select the field called “IncludeOnExport” and set Value to 0 – this will show you all the rows where this field is set to zero. I had 98 keywords set not to export.
One last quirk – if you have JPEGs in your database, the keywords in the file have not been changed, so you need to find those images, select them all, and do a “Save Metadata to File” to update the information in the JPEG itself. I didn’t bother to do this and all my files are already on the various websites and so there is no need to change the files on my computer – I simply wanted a way to stop this problem from occurring again.
So the learning lesson – this “keywords not exporting” problem impacts people who started with Lightroom 1.0 and upgraded through the various releases. The initial keywords were set to “Not Export” during the upgrade path between LR1 and LR2. The unfortunate result for me are a lot of online stock photos that don’t have the most obvious keywords included…