Quote from: MarekV on May 28, 2018, 03:25:21 AM
the condition does not prevent the files with the date prefix to be excluded from the processing:
exiftool -if "not ( ${filename;s/^([0-9]{4})-([0-9]{2})-([0-9]{2}).*/$1-$2-$3/} eq ${datetimeoriginal;s/^([0-9]{4}):([0-9]{2}):([0-9]{2}).*/$1-$2-$3/})" -d "%Y-%m-%d %%f.%%le" "-testname<DateTimeOriginal" -ext jpg .
Your substitution expression for DateTimeOriginal in the
-if condition won't work because DateTimeOriginal is formatted according to the
-d option before your substitution. Try this:
-if "${filename;s/^([0-9]{4})-([0-9]{2})-([0-9]{2}).*/$1:$2:$3/} ne ${datetimeoriginal#;s/ .*//}"I would like to:
1. Keep YYYY-MM-DD prefix if it exists
2. Replace YYYYMMDD (or YYYY or YYYYMM) prefix (if exists) with YYYY-MM-DD
3. Add YYYY-MM-DD prefix if date prefix does not exist
Try this:
"-testname<${DateTimeOriginal}${filename;s/^\d{4,8}//}"This will remove 4-8 digits if they exist at the start of the file name, then add the DateTimeOriginal in the format specified by the
-d option.
Quote4. Add comment from the last directory level without the "YYYY-MM-DD " prefix as the file comment
"-comment<${directory;s(.*/)()}"Quote5. Improve the speed of the processing (we have about 5k photos in each year directory on local NAS and it takes about 30 minutes to process each year directory) with following command:
exiftool -if "$datetimeoriginal and $datetimeoriginal lt ${filemodifydate;s/[-+].*//}" "-dateTimeOriginal>FileModifyDate" -progress -overwrite_original -ext jpg -r .
Is there a question here? FYI, the
-overwrite_original isn't doing anything here because you aren't modifying the file.
- Phil