ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Andreas Spindler on December 21, 2013, 08:01:21 PM

Title: Rename into time folders plus aperture or focal length?
Post by: Andreas Spindler on December 21, 2013, 08:01:21 PM
Hello!

I'd like to (roughly) group panorama and HDR photos by time and aperture, as these photos are shot with equal apertures. For example, I'd like to rename images into a folder like

    2013-12-21/4.0/PC216295.JPG

where 2013-12-21 is DateTimeOriginal and 4.0 is the Aperture value of PC216295.JPG. Is this possible? So far I have...

    exiftool -v0 -r -i -P DCIM -d %Y-%m-%d/%%f_%%-2c.%%le -FileName<$DateTimeOriginal

which creates

    2013-12-21/PC216295.JPG

I had no success by setting the FileName and Directory pseudo-tags using $Aperture in various ways.  :-X
Now its 2 am in the morning and I am stuck. Any help is greatly appreciated!

Andreas
Title: Re: Rename into time folders plus aperture or focal length?
Post by: Phil Harvey on December 21, 2013, 08:09:34 PM
Hi Andreas,

Try this:

exiftool -v0 -r -P DCIM -d %Y-%m-%d "-FileName<$DateTimeOriginal/$aperture/%f_%-2c.%le"

Note that I removed the -i option because it didn't have a valid argument.  I am assuming that DCIM is the name of the source directory.

- Phil
Title: Re: Rename into time folders plus aperture or focal length?
Post by: Andreas Spindler on December 21, 2013, 08:23:41 PM
Phil, perfect! Works! Actually I don't quite understand why, but I'll figure it out tomorrow.

BTW, I found no examples on the web for this case. Maybe this is a useful for the "Writing File and Directory tags" section in the manual, because aperture and focal-length sub-directories can safe time when grouping panoramas/HDRs.

Thanks for answering so quickly.

Greetings from Santa Cruz de la Palma.  8)
Title: Re: Rename into time folders plus aperture or focal length?
Post by: Phil Harvey on December 22, 2013, 10:36:31 AM
The last renaming example in the exiftool application documentation (https://exiftool.org/exiftool_pod.html#renaming_examples) gives a similar command.  Read about the -tagsFromFile option to understand about copying strings with embedded tag values (see the last paragraph).

- Phil