ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: manup on June 16, 2023, 04:31:25 PM

Title: [SOLVED] Save -d location in variable
Post by: manup on June 16, 2023, 04:31:25 PM
Hi,

I'm using exiftool in a bash script to copy photos from a SD card (or a camera) to a specific folder like this:
origFolder="$photoRoot/%Y/%m - %B %y/%y%m%d$labelImport1"
exiftool -o . '-filename<CreateDate' -@ $licenseFile \
      -Keywords+="$labelImport" \
     -d "$origFolder/$labelImport2%y%m%d-%%f.%%e" \
     "$photoFile"

The thing is the destination folder, $origFolder, is in the end an exiftool encoded value which relies on the CreateDate of the input file $photoFile.

Now, after exiftool has moved the file (in fact the files since this sequence is in a loop), I'd need to cd to the real $origFolder where it's been copied.

Is there a way to achieve this? For instance in saving the -d value to some variable?
Title: Re: Save -d location in variable
Post by: StarGeek on June 16, 2023, 05:32:10 PM
If I'm understanding you correctly, the only way to run exiftool with the -d and the -s (-short) option (https://exiftool.org/exiftool_pod.html#s-NUM--short) and capture that output

exiftool -d "$origFolder/$labelImport2%y%m%d-%%f.%%e" -s3 File.jpg

But you should know that running exiftool in a loop will significantly increase the processing time.  See Common Mistake #3 (https://exiftool.org/mistakes.html#M3).
Title: Re: Save -d location in variable
Post by: manup on June 17, 2023, 04:26:42 AM
Thanks @StartGeek, with the help of what you suggested I could sort it out.

I'm pretty sure running exiftool in a loop is less efficient in terms of performance, but the loop allows you to pipe some lines with a zenity --progress that is showing a progression bar I find interesting.

I don't know other way to do it.