ExifTool Forum

ExifTool => Newbies => Topic started by: 83years on March 28, 2014, 08:31:58 AM

Title: Batch processing
Post by: 83years on March 28, 2014, 08:31:58 AM
Hi everyone,

I'm very new to ExifTool but I know exactly what I need and I can do it for 1 image at a time, I am just clueless about how to do it for the 13,000 images I have.

Each image was exported by Aperture 3 as a .JPG .TIF or .PSD with an additional .XMP sidecar file of the same name

I can use the line:

exiftool -tagsfromfile IMAGENAME.xmp -all:all IMAGENAME.jpg (or .tif .psd)

and it adds all the missing data into the .jpg file which can be read by Lightroom.

I think exiftool -tagsfromfile .xpm -o %d%f.JPG DIR should work as a batch command, but it doesn't.

Can anyone tell me why it's not working and maybe give me some pointers as to how to get it to work?

Many thanks  :D

Lucas
Title: Re: Batch processing
Post by: Phil Harvey on March 28, 2014, 08:39:40 AM
Hi Lucas,

It is done like this:

exiftool -tagsfromfile %d%f.xmp -all:all DIR

- Phil
Title: Re: Batch processing
Post by: 83years on March 28, 2014, 08:40:00 AM
It turns out that Phil has already answered this problem....

exiftool -tagsfromfile %d%f.xmp -all:all -r -ext jpg DIR

I found it further down in the forum but couldn't see it with google

Thanks  ;D
Title: Re: Batch processing
Post by: professor_deb on May 04, 2014, 05:26:38 PM
I'm attempting to do the same thing on Mac OS X with batches of JPGs and XMP files generated from software on an iPad (due to limitations on the iPad it will be much easier to tag the files on the iPad using Photogene or Photosmith and then just transfer the small XMP files to be linked back up with the original JPGs from an SD card).

ExifTool does seem to do the job with the command "-tagsfromfile %d%f.xmp -all:all -r -ext jpg DIR"

The strange thing is that the files named "_original" are in fact the altered files, not the actual originals!
Is there something I'm doing wrong? I see that there is a command "-delete_original" but this would actually delete the files that have been modified!

Ultimately I'd like to set up an Automator script or .command file to read the XMP data into the associated JPGs, rename the JPGs using a tag in the XMP file, then delete any duplicate images created by ExifTool in the process.

Thanks very much!

Deborah
Title: Re: Batch processing
Post by: professor_deb on May 04, 2014, 06:45:51 PM
Okay, I think I finally figured out that I need to add the argument "-overwrite_original_in_place" and it seems to write to the original files in the way that I want.

Now I would like to rename the file based on the "Headline" tag. I've been searching and searching through the forums and documentation and nothing seems to work. I'm sure it's just a syntax error.

The command "exiftool -filename<IPTC:headline *.jpg" returns the error "No such file or directory."

I'm sure it's something simple but I'm totally at a loss.

Thanks,

Deborah

Title: Re: Batch processing
Post by: Phil Harvey on May 04, 2014, 09:07:24 PM
Hi Deborah,

You need quotes around the argument containing "<".  Also, you may want to keep the original file extension (%e"), and I recommend using -ext jpg instead of *.jpg.

exiftool '-filename<$IPTC:headline.%e' -ext jpg .

- Phil
Title: Re: Batch processing
Post by: professor_deb on May 04, 2014, 09:15:22 PM
Thanks. Unfortunately still doesn't work.

I entered exiftool '-filename<$IPTC:headline.%e' -ext jpg /Users/Home/Documents/Dropbox/Apps/Photosmith

Terminal returned:    Warning: [minor] Tag 'IPTC:headline' not defined - /Users/Home/Documents/Dropbox/Apps/Photosmith/IMG_8202.jpg
Followed by:    Warning: No writable tags set from /Users/Home/Documents/Dropbox/Apps/Photosmith/IMG_8202.jpg

The images do have the IPTC Headline tag entered, which was from the earlier -tagsfromfile operation. Very confusing!

Thanks
Title: Re: Batch processing
Post by: professor_deb on May 04, 2014, 10:05:18 PM
Okay, finally after several hours this seems to work:

exiftool '-filename<$headline.%e' -ext jpg .

If I put in $IPTC:headline it will not work. I have to leave off the IPTC.

It also appears I can string the two commands together into: -tagsfromfile %d%f.xmp -all:all -ext jpg . -overwrite_original_in_place '-filename<$headline.%e' -ext jpg .
It will then read the XMP data into the file and then rename the file based on the IPTC tag...that's pretty amazing!

Thanks!
Title: Re: Batch processing
Post by: Phil Harvey on May 05, 2014, 07:31:54 AM
Hi Deborah,

What version of ExifTool are you using?  This should work for any version less than a few years old.

And yes, you can perform any number of operations in one command.

- Phil