How to use "CreateDate" field to set the -Geotag log file name?

Started by mikesouza, June 03, 2013, 11:46:48 AM

Previous topic - Next topic

mikesouza

Hi.

Is it possible to extract CreateDate field from each file and use date parameters in specifying GPS log filename? For example, my GPS logs are in LOG-{YYYY}-{MM}-{DD}.GPX format (i.e., LOG-2013-06-01.GPX). I am processing a bunch of images and would like each image to use a GPS log from the date the image was created:


exiftool -Geotag LOG-%Y-%m-%d.gpx *.JPG


%y, %m, and %d should be taken from the image's CreateDate field.

Thanks.

Phil Harvey

I can't think of an easy way to do what you want, but instead you could just load all of the available track logs at once:

exiftool -geotag "LOG-*.gpx" *.JPG

- 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 ($).

mikesouza

Thanks, Phil. That's what I do now but it really slows down the process if I have hundreds of images and large log files.

I wish there was a way to assign tag information to a variable (e.g., "$var<CreateDate[%Y%m%d]") and then use it as an option (e.g., "-geotag $var").

Phil Harvey

The problem is that the -geotag option loads all of the track logs before exiftool processes the first image file.  So what you are suggesting can not be easily implemented in the current scheme.

- 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 ($).

mikesouza

Makes sense now. Maybe a slight tweak in future versions will allow for that :)

mikesouza

P.S. Is there a way to geotag images ONLY if GPS tags do not exist?

Phil Harvey

Yes:

exiftool -if 'not $gps:all' ...

(use double quotes instead of single if you are on Windows)

- 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 ($).