Condensing into 1 line

Started by b193709, June 07, 2023, 04:58:19 PM

Previous topic - Next topic

b193709

Hi all:

I think I'm right on this.. just looking for confirmation:

find ./"$1"/ -iname *.cr2 -depth -print0 | xargs -0 exiftool -progress   -d "$2/%m-%Y/%d-%m-%Y"   '-directory<datetimeoriginal'

find ./"$1"/ -iname *.nef -depth -print0 | xargs -0 exiftool -progress   -d "$2/%m-%Y/%d-%m-%Y"   '-directory<datetimeoriginal'

find ./"$1"/ -iname *.arw -depth -print0 | xargs -0 exiftool -progress   -d "$2/%m-%Y/%d-%m-%Y"   '-directory<datetimeoriginal'

find ./"$1"/ -iname *.mov -depth -print0 | xargs -0 exiftool -progress   -d "$2/%m-%Y/%d-%m-%Y"   '-directory<CreationDate'

find ./"$1"/ -iname *.mov -depth -print0 | xargs -0 exiftool -progress   -d "$2/%m-%Y/%d-%m-%Y"  '-directory<MediaCreateDate'

Into this one:

find ./"$1"/ \( -iname *.nef -o -iname *.cr2 -o -iname *.arw -o -iname *.mov \) -depth -print0 | xargs -0 exiftool -progress  -d "$2/%m-%Y/%d-%m-%Y"  '-directory<MediaCreateDate'  -d "$2/%m-%Y/%d-%m-%Y"   '-directory<CreationDate' -d "$2/%m-%Y/%d-%m-%Y"   '-directory<datetimeoriginal'

Thanks


Phil Harvey

You should never have to use "find".  (Common mistake number 3.)  Try this instead:

exiftool -ext nef -ext cr2 -ext arw -ext mov -progress -d "$2/%m-%Y/%d-%m-%Y" '-directory<MediaCreateDate' '-directory<CreationDate' '-directory<datetimeoriginal' "./$1"

Also note that multiple -d options are not allowed, and the last one is applied to all date/time values.

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

b193709