Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Plugin to export XMP

Guest
Nov 27, 2012 Nov 27, 2012

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!

TOPICS
SDK
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 27, 2012 Nov 27, 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 27, 2012 Nov 27, 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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 27, 2012 Nov 27, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 27, 2012 Nov 27, 2012

Actually, one more request: could you please briefly explain how keyboard injection works as a Lightroom plugin? I am just curious. Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 28, 2012 Nov 28, 2012

autohotkey in windows, applescript on mac.

Download xEmP (includes source code), and you can see how it's been done.

Note: Mac has become more of a problem lately - some systems don't allow on-the-fly execution of text scripts (and some do...). I really need to compile the applescript, assuming that would help - it's on my to-do list...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 29, 2012 Nov 29, 2012
LATEST

Funny coincidence, I just wrote a little XMP extractor plugin this afternoon, it's implemented as an export filter plugin.  (It is going to be a part of a bigger plugin later on.) 

I need it to extract developed XMP data, so I just use export original option and insert this plugin as a post-process action.  If the original is TIF, JPEG, PSD, DNG then the XMP will be embedded and I then use exiftool to extract it.  For other RAW files, LR exports XMP itself. 

Btw, LR export is quite fast when exporting original images, because it does not need to actually render any pixels...

Plugin is available from http://www.capturemonkey.com/xmpextract in case you want to try that approach.

There's no source there, but it is basically just calling exiftool inside postProcessRenderedPhotos method, less than 20 effective lines anyway

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines