Image-ExifTool - Re: How to do a compound IF statement

Posted on Thu Dec 20 06:13:48 2007 by bv in response to 6730 (See the whole thread of 3)
Re: How to do a compound IF statement

I finally got a working ArgFile. I inserted the -P and -overwrite_original repeatedly because I was calling this from another @ Argfile and the -common_args option does not work inside of the Argfile (accouding to documentation). So they would never make it to the other -execute sections.
Any cleanup suggestions are welcome.

# FixAllDates-Canon.arg - Exiftool v.7.06 @argfile # Usage: # exiftool -@ FixAllDates-Canon.arg -common_args *.JPG # exiftool -overwrite_original_in_place -@ FixAllDates-Canon.arg -common_args *.JPG # exiftool -P -overwrite_original_in_place -DateTimeOriginal="2005:05:22 00:00:00" *.jpg # exiftool -P -overwrite_original_in_place -DateTimeOriginal="2005:04:23 00:00:00" *.jpg # Verify: exiftool -Make -alldates -r ./ * # exiftool -AllDates -if "not $dateTimeOriginal or $dateTimeOriginal !~ /^[12]/" -r ./ *.jpg # # if all dates are missing, set DateTimeOriginal to FileModifyDate # -P -overwrite_original -DateTimeOriginal<FileModifyDate -CreateDate<FileModifyDate -ModifyDate<FileModifyDate -if ($Make eq "Canon") and (not $dateTimeOriginal or $dateTimeOriginal !~ /^[12]/) and (not $ModifyD +ate or $ModifyDate !~ /^[12]/) and (not $CreateDate or $CreateDate !~ /^[12]/) -execute # # if DateTimeOriginal and CreateDate dates are missing, set to ModifyDate -P -overwrite_original -DateTimeOriginal<ModifyDate -CreateDate<ModifyDate -if ($Make eq "Canon") and (not $dateTimeOriginal or $dateTimeOriginal !~ /^[12]/) and (not $ModifyD +ate or $ModifyDate !~ /^[12]/) -execute # # if DateTimeOriginal and ModifyDate dates are missing, set to creatDate # -P -overwrite_original -DateTimeOriginal<CreateDate -ModifyDate<CreateDate -if ($Make eq "Canon") and (not $dateTimeOriginal or $dateTimeOriginal !~ /^[12]/) and (not $CreateD +ate or $CreateDate !~ /^[12]/) -execute # # if DateTimeOriginal is missing, set to creatDate # -P -overwrite_original -DateTimeOriginal<CreateDate -if ($Make eq "Canon") and (not $dateTimeOriginal or $dateTimeOriginal !~ /^[12]/) -execute # # if CreateDate date is missing, set to dateTimeOriginal # -P -overwrite_original -CreateDate<DateTimeOriginal -if ($Make eq "Canon") and (not $CreateDate or $CreateDate !~ /^[12]/) -execute # # if CreateDate date is missing, set to dateTimeOriginal # -P -overwrite_original -ModifyDate<DateTimeOriginal -if ($Make eq "Canon") and (not $ModifyDate or $ModifyDate !~ /^[12]/) # end of FixAllDates-canon.arg
Direct Responses: 6733 | Write a response