ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: b193709 on June 07, 2023, 04:58:19 PM

Title: Condensing into 1 line
Post by: b193709 on June 07, 2023, 04:58:19 PM
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

Title: Re: Condensing into 1 line
Post by: Phil Harvey on June 07, 2023, 09:01:33 PM
You should never have to use "find".  (Common mistake number 3 (https://exiftool.org/mistakes.html#M3).)  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
Title: Re: Condensing into 1 line
Post by: b193709 on June 09, 2023, 04:11:51 PM
Thanks Phil