Luke MacNeil

On airPlaying tonight — Planet Marfa

Software

Lightroom publish service

A real bidirectional publish plugin for Lightroom Classic, because every existing one is a one-way exporter.

shippedLua · Lightroom Classic SDK · Cloudflare Workers · R2

Every Lightroom plugin I had tried was an exporter wearing a publish service’s clothes: it pushes files out and then forgets them. Remove a photo from the collection and the website never finds out.

This one is a real LrExportServiceProvider with publish extensions. A collection is a gallery. Drag a photo in and it appears on the site; take it out and it is deleted. Edit a title, a caption, a keyword or the GPS and Lightroom flags the photo to re-publish on its own. Sort order in the catalog is the order on the page.

Reading the catalog, not the file

The obvious approach — parse the exported JPEG — gets nothing, because the export pipeline strips EXIF. Reading the catalog also gets fields no file format carries: collection membership, pick flags, plugin settings.

GPS is rounded to about a kilometre by default. A dark-sky site is worth not publishing to the metre.

What the SDK does not tell you

Lightroom’s metadata accessors yield internally, and Lua 5.1 forbids yielding across a C call boundary. Wrap them in the built-in pcall — a reasonable instinct, since one unrecognised key otherwise aborts a whole publish — and every read fails with “Yielding is not allowed within a C or metamethod call”. The photo publishes as “Untitled” with no metadata and no obvious cause. LrTasks.pcall is the yield-safe version.

Two more that cost an afternoon: declaring getCommentsFromPublishedCollection tells Lightroom the service supports comments, and its startup refresh then tears down the entire Publish Services panel — including other plugins’ services — when the call returns nothing. And LR_size_units is not optional: without it a resize constraint is read as inches, so a “4000” limit silently publishes at full resolution.

All software