
Get Search & Replace from Photographer’s Toolbox
A couple of changes to Search & Replace plugin (available from here) may appear small on the surface, but in fact they are built on such a significant extension to the plugin’s capability that they merit a jump to version 3.
What’s new is that the plugin is now reading information directly from the catalogue SQL data to:
- Get people named by LR’s facial recognition and list them from left to right
- Convert reverse-geocoded locations to locally-entered values
Over the years many people have asked me about using this information. Often they question why the plugin’s Caption Builder or Transfer functions don’t read the four IPTC location fields like Country and Location for some photos, and it was usually because those fields displayed text in italics. This indicated that they were “reverse-geocoded” or obtained from Google, and Adobe have never allowed plugins to read this data. The solution was to enter the location fields manually, which is tedious. Similarly, maybe as a result of privacy concerns or some 3rd party licences, Adobe have never let plugins read the facial recognition regions, and other potentially-useful information isn’t available too.
Others’ plugins have worked around these limitations, bypassing the Google-based geotagging or by using 3rd party tools to access the catalogue’s SQL. I just preferred Search & Replace to focus on the best use of SDK, Adobe’s approved and documented way to access the Lightroom catalogue.
Last week I got yet another request from a user to generate captions with people identified by LR’s facial recognition,listed left-to-right. Keywords were no use, because any photo would have lots of other keywords, and in any case LR lists keywords alphabetically. So I dusted off those earlier experiments.
The big challenge was figuring out how Adobe store the data. The database organisation is not publicly-documented and was never designed to be accessed in this way. What’s more, the structure is as opaque as one might expect of something that it’s been implemented by a variety of developers over Lightroom’s 20 years.
Still, once I’d done it for Named People, I then moved on to the italicised IPTC Location fields. I’ll look at other gaps in the future – especially Sync data such as Likes and Comments. Going beyond the SDK and interrogating the database will enable the plugin to find and use such data, and this additional capability seems worth a major release – 3.0.
Named People – two ways to use the field

The new Named People field can be used like any other field
In Search & Replace’s main dialog box, field drop down menus now have Named People L-R listed under the main IPTC fields (below), so you can access it like other fields:
- If LR’s facial recognition has tagged a person, or if you added faces manually in Loupe view their names will be output left to right using the region data recorded in LR
- You can copy Named People L-R into other IPTC fields or to the plugin’s custom fields
- Or use it to create captions on the Caption Builder tab
Secondly, in Library Filter there is now a Named People * custom field:
- It is populated when you run Search & Replace’s Workflow Filters command
- It’s available so you can filter the catalogue to find pictures which are / aren’t face tagged
- Once Named People * is populated, you can use it in like other custom fields in Caption Builder as an alternative to the real time Named People field
- Remember that Named People * isn’t real time – to refresh it, you’d have to re-process those photos with the Workflow Filters command

In Caption Builder, the Named People L-R field adds the names of people tagged in the photos, listing them left to right

You can filter the catalogue to find pictures which are/aren’t face tagged
IPTC locations
There is a new button on the Workflow Filters tab which lets you convert italicised or reverse-geocoded IPTC locations to regular fields stored in the catalogue. This makes them available to plugins and also saves the values to XMP.

On the Workflow Filters tab, you can convert reverse geocoded values into regular values in the catalogue

Italic text indicates these locations are reverse geocoded by sending the GPS to Google
How is it done?

The data extracts are stored in a subfolder of the user’s Documents, jbPlugins folder
As the plugin is unable to get this information via the SDK, the new features use SQLite to access the catalogue. On Mac this utility is usually installed as part of the OS, and for Windows an executable is now inside the plugin.
Each time you open the plugin’s main dialog box, Search & Replace sends SQLite an instruction to query the selected files’ data and output a text file, which it then reads and obtains any information.
And why might that matter?
There are separate text files for Named People and Locations, and these files should be generated so quickly that they are ready by the time the plugin reads them.
But if very large numbers of photos are selected, it is conceivable that a file hasn’t been output quickly enough and the plugin would be unable to read the Named People or Locations values.
The problem should be fixed by just waiting a few moments for the process to complete, or by toggling the forward and back buttons (bottom left of plugin dialog). Do report any problems in this area.