Skip to main content
November 28, 2012
Question

Plugin to export XMP

  • November 28, 2012
  • 1 reply
  • 2028 views

I'm new to Lightroom plugin development, but I am quite familiar with the Lightroom application, SQL, and Lua. I really dislike how Lightroom does not allow XMP sidecar files for JPGs, even though that situation hardly occurs, it bothers me. So, decided to try to make a plugin and although the documentation is pretty good, there aren't many forums to ask for help.

Here is what I think I need to know how to do:

  1. Is there a way of getting at the SQLite database directly?

    The SQLite table Adobe_AdditionalMetadata has an xmp text column. It seems like it would be simple to export this to an .xmp file. I don't see any way of accessing it via the LR API though. Access each develop setting individually sucks because I'd have to construct the XML file, and even then, I wouldn't be able to access snapshots.

  2. Is there a way I could trigger an export of the XMP file?

    It seems as though the LR API works off context menu events, not Lightroom events.

Any suggestions are greatly appreciated. Thank you!

This topic has been closed for replies.

1 reply

areohbee
Legend
November 28, 2012

It's gonna be hard to build xmp from scratch, as a plugin, me-thinks. As you've already noticed, the database is not accessible, except in very limited fashion via SDK. It may be worth considering extraction of xmp from jpg instead, or as a starting point, via exiftool, like xEmP does. I use keyboard injection to trigger xmp save, but that technique leaves a lot to be desired (doesn't work reliably). If you are hell-bent on doing it from scratch, I think you'd have to read the catalog upon startup, or an inactive catalog of the catalog after startup... Note: it would be easy to create xmp from a non-plugin app without Lightroom running, since the xmp is essentially there at the ready, not sure what issues there might be in assuring freshness...

November 28, 2012

Yeah, I have already used tools in the past that can easily and perfectly extract the XMP (exiv), but I guess I just really wished that feature was in Lightroom natively and I was hoping to implement it myself.

Thank you for the feedback!

areohbee
Legend
November 28, 2012

I mean, everything about the job is easy, *except* the database is locked, and SDK doesn't provide the requisite info. If you don't mind generating xmp upon startup, instead of during operation, it's cake. Generating fresh stuff while running however - don't see how else besides save-to-jpeg in Lightroom, followed by extraction using exiftool.

Good luck,

Rob