TagsFromFile fails to block copy during batch run

Started by sn0cr4sh, December 23, 2012, 11:27:28 PM

Previous topic - Next topic

sn0cr4sh

I am attempting to run a batch process on DNG files, and export out XMP sidecars.  The DNGs were edited in Lightroom 4.3.  I am using v9.09 of Exiftools.

The following command:
exiftool -tagsfromfile SRC.dng -xmp DST.xmp
correctly generates an XMP file, which when run back into LR 4.3, is consistent with the edits applied to the photo.  This is run on a single source file, generating a single destination XMP file. 

I need to run a batch, so I used the batch syntax indicated in the documentation.

This command:
exiftool -ext dng -tagsfromfile %d%f.xmp -r "SRCDIR"
generates the XMPs, but they are incorrect.  Specifically, the XMP files drop Temperature and Tint adjustments from LR.  So this suggests they are not getting block copied.

Am I running the batch incorrectly or is there an error in the block copy of the data?

Phil Harvey

#1
Quote from: sn0cr4sh on December 23, 2012, 11:27:28 PM
This command:
exiftool -ext dng -tagsfromfile %d%f.xmp -r "SRCDIR"
generates the XMPs, but they are incorrect.  Specifically, the XMP files drop Temperature and Tint adjustments from LR.  So this suggests they are not getting block copied.

Could you post the original XMP from one of these images so I can test this?  If ExifTool is missing some tags I would like to add them.

But your problem is that you want to do a block copy of the xmp.  To do this, you need to specify the XMP block:

exiftool -ext dng -tagsfromfile %d%f.xmp -xmp -r "SRCDIR"

Otherwise the tags are copied individually.

- Phil

Edit: I think that in your command some tags weren't copied because some XMP-crs tags are avoided due to name conflicts with other tags.  In this case, adding -xmp:all would have copied these tags.  I'd still like to see your XMP though, so I can make sure I understand what was happening.  I did some playing around with LR 4.2 and found some missing tags, but not the ones you mentioned.  (However, this is an aside because it sounds like copying as a block is what you should be doing.)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

sn0cr4sh

So in both of my scenarios: the single-file run and the batch run, should I be using the -xmp:all command to ensure a full block copy of all XMP info?  I don't even know all the possible tags that LR puts in, so doing a blanket copy of anything and everything is ideal.  Is that a guaranteed way of copying everything out?

I can't really post these to a public forum, but can send to you privately if you like.  I can send the source DNG, original RAW, and exported XMPs so you can see the full scope. 


Phil Harvey

Thanks.  All I need is the exported XMP.  My email is philharvey66 at gmail.com

Using -xmp:all copies all writable XMP tags indivually to the same locations in the target file.  This is used if the target already contains some XMP and you want to add the XMP from the other file.  Using -xmp copies XMP as a block.  This will copy all XMP tags even if they aren't individually writable by ExifTool, and will also preserve the original structure of the XMP (which really doesn't matter), but will overwrite any existing XMP in the target file.  Which one you choose depends on your specific requirements.

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

sn0cr4sh

I may have mucked this up a bit too.  In my original post, the syntax for the Batch copy isn't correct / appropriate.  That command requires the XMPs to already exist, then injects the XMP data back into them, right?

I noticed this because I tried to run again to set up XMPs to send you.  It failed because I cleared out all existing XMPs before running.  Couldn't find source, so it failed.  In any scenario, if I run an XMP creation pass, I would want it to completely overwrite and obliterate anything that previously existed - on a file level, not a tag level.

So I cleared out all XMPs and I used this command: 
exiftool -ext dng -o %d%f.xmp -r "SRCDIR"
which does generate the XMPs on their own.  It still creates the failure state previously mentioned.

I'm emailing them to you so you can see.

Phil Harvey

OK.  The command you used is the default commuting per-tag copy, which doesn't help me.  From your description, it seems you want to do this to generate the XMP files:

exiftool -ext dng -r -xmp -b -w! xmp "SRCDIR"

note that with the exclamation point (-w!), this command will overwrite existing XMP files.

This would give the XMP file I am looking for.

- Phil

(yes, there are lots of different ways to do similar things with ExifTool)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

sn0cr4sh

Well, wouldn't you know - it works correctly.   ;D 

Using that syntax against the folder, the XMP brought over the tags I was missing before, and is a perfect match to the single-file run I did previously.

So I suppose it's not really a bug, but more of an issue of matching the proper syntax to the desired workflow. 


Quote from: Phil Harvey on December 24, 2012, 04:10:37 PM
OK.  The command you used is the default commuting per-tag copy, which doesn't help me.  From your description, it seems you want to do this to generate the XMP files:

exiftool -ext dng -r -xmp -b -w! xmp "SRCDIR"

note that with the exclamation point (-w!), this command will overwrite existing XMP files.

This would give the XMP file I am looking for.

- Phil

(yes, there are lots of different ways to do similar things with ExifTool)