Skip to main content
NickCL
Participant
August 18, 2010
Answered

Progamming export / import of XMP

  • August 18, 2010
  • 1 reply
  • 2553 views

Hi folks,

I'm still very new to this (just bought a book on Lua ) but I want to create something that export the XMP files (so that I can edit them on the road) and import them back to Lightroom. I've been reading the API reference and SDK manual lately, had a feeling that this is not possible but since I've seen some workarounds to achieve certain goals in this forum, thought still worth asking.

So, assuming that this is not possible, here are a few of my ideas:

  • Create some keyboard macros to automate the XMP export / import porcess. It'd nice and sweet if it's some simple application I'm dealing with, but with a complex app like Lr there are too many unpredictables and since it's all valuable data maybe this is not a good idea.
  • Create a plug-in that does not thing but generate XMP files using the post-processing part, and then import edited XMP manually. In this case though, I wonder if it's even possible to create a plug-in that will not export photos but only performs post processing.

Would anyone please shed some lights?


Thanks.

Nick.

This topic has been closed for replies.
Correct answer areohbee

Hi Rob,

To be honest I just Googled your name and found your web site that contains plug-ins that do similar things of what I wanted to do, this is nice to know because I just wanted to know if there's a way to go around this -- I didn't want to waste my time putting codes that wouldn't eventually give me what I wanted, thus the intention to ask the question in the first place. ;-)

I have some development background dealing with XML version control and conflict management so merging online VS offline content is okay for me, -- since all I want to do at moment is editing keywords and titles (or any other description fields) maybe I'll just create some CRC from online files, and write any changed values in the offline file back to the online file.

How I plan to edit the XMP file was to create a XSLT stylesheet that converts XMP files into a spreadsheet so I can edit on the road. If it's too much work I might just create a PHP script that sits on my home PC host the XMP web edit interface so I can edit them from any device with a web browser -- with this method I might not even have to deal with XMP versioning since I'll probably have the PHP to read XMP and write changes in realtime.

The mortifying part is -- as you pointed out already -- using a keyboard macro isn't really elegant, but guess this is the only way to automate this kind of stuff...


Thanks.

Nick.


Nick,

You can always harvest code from those plugins too - they are not compiled.

Sounds like you know enough programming that once you are up to speed with Lua and the SDK you'll knock something out in no time - doncha think?

_R

1 reply

areohbee
Legend
August 18, 2010

Just hit ctrl/cmd-s and Lightroom will export all your xmp. Then 'Metadata Menu -> Read Meta From Files' will import it into your catalog.

This works for ordinary raws. If your files are dng or jpeg you can extract the xmp using exiftool. in the former case (dng) it will be read back in using 'Metadata Menu -> Read Meta From Files'. I'm not sure about the latter case (jpeg) - probably won't import it.

Or am I not understanding what you are trying to do?

PS - I used to edit the xmp all the time using text-editor macros and grep utilities and little mini-apps I would write... to do things not supported in Lightroom. I mostly do that stuff using SDK3.0 plugins now...

Rob

NickCL
NickCLAuthor
Participant
August 18, 2010

Hi Rob,

Thanks for your prompt advice -- much appreciated.

Sorry for not mention it earlier, but I already know how to manually export / import XMP files and extract / modify XMP from a non-RAW file.

What I wanted to achieve is, say I select a group of photos and maybe click a button and Lightroom will export the XMP files to a desired destination so I can grab them and add keywords or titles later / elsewhere. When I finish editing the XMP files the next thing I want to do is to import the XMP to reflect changes in Lightroom.

You mentioned that you're already able to do this kind of things using SDK3.0 plugins, so I assume there are already API in SDK 3.0 for us to do this kind of things? Would it be an Export plug-in or custom metadata programming?

Thanks.

Nick.

areohbee
areohbeeCorrect answer
Legend
August 18, 2010

Hi Rob,

To be honest I just Googled your name and found your web site that contains plug-ins that do similar things of what I wanted to do, this is nice to know because I just wanted to know if there's a way to go around this -- I didn't want to waste my time putting codes that wouldn't eventually give me what I wanted, thus the intention to ask the question in the first place. ;-)

I have some development background dealing with XML version control and conflict management so merging online VS offline content is okay for me, -- since all I want to do at moment is editing keywords and titles (or any other description fields) maybe I'll just create some CRC from online files, and write any changed values in the offline file back to the online file.

How I plan to edit the XMP file was to create a XSLT stylesheet that converts XMP files into a spreadsheet so I can edit on the road. If it's too much work I might just create a PHP script that sits on my home PC host the XMP web edit interface so I can edit them from any device with a web browser -- with this method I might not even have to deal with XMP versioning since I'll probably have the PHP to read XMP and write changes in realtime.

The mortifying part is -- as you pointed out already -- using a keyboard macro isn't really elegant, but guess this is the only way to automate this kind of stuff...


Thanks.

Nick.


Nick,

You can always harvest code from those plugins too - they are not compiled.

Sounds like you know enough programming that once you are up to speed with Lua and the SDK you'll knock something out in no time - doncha think?

_R