Author Topic: Updating XMP Files  (Read 1395 times)

sjDelaney

  • Jr. Member
  • **
  • Posts: 25
Updating XMP Files
« on: May 03, 2016, 04:25:25 PM »
How do I update XMP files that have been created by Lightroom? 

I’m able to update “keywords” in jpegs using Image::Exiftool in Perl. Once that’s done there’s a LR plug-in that will sync keywords with the updated jpegs - but it’s slow and it works against my workflow.  I know little about XMP files, except that LR creates them, several apps read them, and they pair up with my my NEF files which I am loath to touch.

What I’d like to do is import my NEF files to Lightroom, run a script to update all XMP files, ensure LR recognizes the updated files, complete the rest of my work within LR, and generate the jpegs complete with keywords after all relevant post-processing is done.

Do I need a special “configuration” file to work with XMPs? 
If so, wouldn’t I base it one what LR, since Lightroom is the application that creates all my XMPs?
Do you need a special configuration file application?

I’m not much on xml (I’m from the EDI era), but XMP files look a lot like text based hashes to me.
Is updating XMP files easier or harder than working with image files?

I’m still cleaning and testing my script for updating jpegs, but if it’s possible to replace the jpeg statements with XMP statements, I’m happy to post the code to this thread.

-sd

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Updating XMP Files
« Reply #1 on: May 04, 2016, 07:33:21 AM »
ExifTool writes XMP files just the same as JPEG, NEF, etc.  See the Metadata sidecar files page for some hints about working with sidecar files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

sjDelaney

  • Jr. Member
  • **
  • Posts: 25
Re: Updating XMP Files
« Reply #2 on: May 04, 2016, 01:28:44 PM »
Thanks,  I was thinking the following example apples.  I'll test it from the command line, but it looks like it writes a new file merging src xmp data with the new tag(s).

-------

16.  Write a tag to XMP sidecar if it exists, or the original file otherwise:

exiftool -ext EXT -artist="Phil" -srcfile %d%f.xmp -srcfile @ DIR

When multiple -srcfile options are used, the first existing file is processed. If none of the specified source files exists, then the first one in the list is created (however, this won't happen with this example since one of the specified source files is "@", which represents the original file name).