Batch setting Capture Time to a range according to filename?

Started by wyx087, July 16, 2017, 11:21:55 AM

Previous topic - Next topic

wyx087

Hi all, I hope I'm in the correct forum subsection.

I have started the task to digitise all of the old family photo. It's going well so far, except for one thing: capture time.

Obviously capture time of the digital version is incorrect. The order of digitising are also incorrect. I've manually re-ordered the photos in Lightroom using the Custom Order catalogue view drag and drop feature. I then have managed to export the photos with a number sequence, so the files themselves are in the correct order when sort by file name. However my photo website software default to sort by capture time, and changing this is too complicated for my dear old mother.

Is there a way to set the correct capture date and time of the photos in bulk?
For example, I know all these photos are taken in the year 1989, and I have them in the correct filename order. Is there a way to set the capture time of the 50 photos within time range of 01/01/1989 and 31/12/1989. The photos will spread evenly across the range I specified, according to the pattern I specify (in this case, file name)

I searched for Lightroom plug-in but cannot find anything and I've now expanded my search on EXIF editors.

Hopefully people here have encountered similar problem and have found suitable solutions. :)

Many thanks

StarGeek

It can be done.  This post has some examples where the time between photos by a variety of second increments. 

Do you need the images evenly spread across an range of times?  That would be a bit more difficult to do and I'm not sure I see the advantage, since the time stamps aren't going to be accurate anyway.  Just picking an approximate year and month and incrementing by seconds or minutes from there would give you the same order results.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

wyx087

Many thanks! I can't figure out the increment values to my needs, so I just made a basic shell script.

Using the EXIFtool, my script below sets photo capture dates to year value provided when calling the script, month starting from January, date starting from 20th. Date is incremented by 2 and at 28th month is incremented by 1. It will also throw out an error if there's too many photos to fit into year specified with the script increments.


#!/bin/sh
#Example: exiftool "-datetimeoriginal=1996:02:01 10:10:10" 00001_DSCE4107.jpg

echo ">  Setting all files to the year $1 "

# Starting values for month and date
COUNTMONTH=1
COUNTDAY=10

# For each file in the current working directory
FILES=$(pwd)/*
for f in $FILES
do
  echo ">> Processing $f "
  echo ">>> New values: $1:$COUNTMONTH:$COUNTDAY"
  # Call the actual exiftool command
  exiftool "-datetimeoriginal=$1:$COUNTMONTH:$COUNTDAY 10:10:10" $f

  let COUNTDAY+=2
  if [ $COUNTDAY -gt 28 ]
  then
    let COUNTDAY=2
    let COUNTMONTH+=1
    if [ $COUNTMONTH -gt 12 ]
    then
      echo ">>!!! Error: too many photos, edit script to reduce increment values !!!<<<"
      exit 1
    fi
  fi
done

# Clean up EXIFtool generated originals
rm *.jpg_original