ExifTool Forum

ExifTool => Newbies => Topic started by: Piet martyn on March 20, 2021, 12:53:23 PM

Title: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: Piet martyn on March 20, 2021, 12:53:23 PM
Hi,
I have scanned 6000 negatives in TIFF format from 1978-2003,saved them in folder's for each year and entered in all the photos the date using photo mechanic, the time are not in order due to the scanning.
I want to syncronize the three Date Time formats for each photo so they are all the same to make it easier for sorting and to find any photo by capture date.

I would like to copy the date (DateTimeOriginal) to the capture time (DateCreated) and also reset the HH:MM:SS to 00:00:00 then increment all the files in the same folder by five seconds.

I am totally new to this and have tried to find a method to do this on the forum, using copy/paste for the commands, unfortunatly I am not used to this kind of programming. I am using the exiftoolGUI interface.

Does anybody who has scanned photos done anything similar that can provide me with the command sequence.
Any help will be gratly appreciated.
Best regards, Piet Martyn
Title: Re: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: StarGeek on March 20, 2021, 01:50:54 PM
I can't help with regards to the ExiftoolGUI, since it doesn't work on my system and it hasn't been supported in nearly 9 years (https://exiftool.org/forum/index.php?topic=4553).

I'm assuming you want to reset the time on DateTimeOriginal as well as CreateDate.

On the command line, it's a two step procedure, only slightly different from this Photo StackExchange answer (https://photo.stackexchange.com/questions/60342/how-can-i-incrementally-date-photos).

First, you would run
exiftool "-AllDates<${DateTimeOriginal;s/ .*$//} 00:00:00}" /path/to/files/

This will copy the date and set the time to 00:00:00 for CreateDate, DateTimeOriginal, and ModifyDate.

You would then run this command, which will increment the time stamps by 5 seconds per file.
exiftool "-AllDates+<0:0:${filesequence;$_*=5}" /path/to/files/

This command creates backup files.  Add -Overwrite_Original (https://exiftool.org/exiftool_pod.html#overwrite_original) to suppress the creation of backup files.  Add -r (https://exiftool.org/exiftool_pod.html#r-.--recurse) to recurse into subdirectories.  If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.
Title: Re: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: Piet martyn on March 20, 2021, 03:46:16 PM
Hi StarGeek,
That's amazing, I tried it in ExifToolGUI and it worked perfectly. Sorting works correctly in all the programs I use.
Thanks for all your help and fast reply.
Best regards
Piet Martyn
Title: Re: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: MEH_PDX on August 09, 2022, 09:14:29 PM
This worked great for me. But I would like to better understand the commands.

Can you direct me to correct section of Exiftool documentation that explains the syntax of these commands.


exiftool "-AllDates<${DateTimeOriginal;s/ .*$//} 00:00:00}" /path/to/files/

This will copy the date and set the time to 00:00:00 for CreateDate, DateTimeOriginal, and ModifyDate.

You would then run this command, which will increment the time stamps by 5 seconds per file.
exiftool "-AllDates+<0:0:${filesequence;$_*=5}" /path/to/files/

Thanks,
Mike
Title: Re: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: Phil Harvey on August 10, 2022, 08:06:31 AM
Quote from: MEH_PDX on August 09, 2022, 09:14:29 PMexiftool "-AllDates<${DateTimeOriginal;s/ .*$//} 00:00:00}" /path/to/files/

I think this has an extra unnecessary "}".  It should probably be

exiftool "-AllDates<${DateTimeOriginal;s/ .*$//} 00:00:00" /path/to/files/
The paragraph beginning with "A powerful redirection feature" in the -tagsFromFile documentation (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) and the Advanced formatting feature (https://exiftool.org/exiftool_pod.html#Advanced-formatting-feature) section explain this syntax.

- Phil
Title: Re: Scanned negatives. Syncronize the 3 Date Time formats and add incremental time.
Post by: StarGeek on August 10, 2022, 10:28:10 AM
Also, the ;s/ .*$// part of this command falls under the "arbitrary Perl expression" part of the "Advanced formatting feature".  In this case, it's a Perl Regular Expression (RegEx) substitution.  RegEx is a complicated subject beyond the scope of this forum.  It is best learned through the many tutorials that can be found on the web.