Hi everyone,
I would like to know if someone knows how to delete all images in a directory on time condition, e.g. :
exiftool -if (datetimeoriginal le "2023:02:07 06:47:13.100" or datetimeoriginal ge "2023:02:07 06:59:12.600") -delete
Thank you in advance !
ExifTool won't delete image files, but you can move them to a directory and delete them yourself. Assuming you are on Mac or Linux, it would look something like this:
exiftool -if '$datetimeoriginal le "2023:02:07 06:47:13.100" or $datetimeoriginal ge "2023:02:07 06:59:12.600"' -directory=delete DIR
then
rm -rf delete
but you should make sure the desired images are in the "delete" directory before you dispose of them. It is fairly easy to blunder the -if syntax.
- Phil
ok, thank you very much Phil.
I tried :
exiftool -if 'datetimeoriginal le "2023:02:07 06:43:48.600" or datetimeoriginal ge "2023:02:07 06:43:50.800"' -directory=delete_dir frames_dir -v3
and the output is :
QuoteCondition: Bareword "datetimeoriginal" not allowed while "strict subs" in use - frames_dir/session_2023_02_07_hermitage_plancha_body_v1A_00_2_2167.jpeg
-------- frames_dir/session_2023_02_07_hermitage_plancha_body_v1A_00_2_2167.jpeg (failed condition)
for each image in the directory.
Obviously I checked that there are some images with the datetimeoriginal exif tag in between, but at the end the delete_dir is still empty.
Do you have any idea ?
Have a good day!
Sorry. My mistake. I've fixed the command in my post.
- Phil
Thank you very much, now it works perfectly :D