1

I have multiple images that have been scanned from 6x4 prints, not knowing when the photo has been taken, most of the photos have not been taken on a particular event, but knows the year taken.

A one command to randomise the creation date on multiple JPG images on a specific year.

jcron13
  • 17
  • 4

1 Answers1

2

The easiest way to do this would be to first set all files to the first second of the year you want to randomize
exiftool -CreateDate="1985:1:1 0:0:0" /path/to/files/

Then you could shift that time by a random number of days/hours/minutes/seconds like this
exiftool "-CreateDate+<${Filename;$_=int(rand(365)).' ' .int(rand(24)).':'.int(rand(60)).':'.int(rand(60))}" /path/to/files

Here, Filename is used as a placeholder to access exiftool's Advanced formatting feature, i.e. using direct Perl code, to get a random day, hour, minute and second to add to the base time.

This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories. If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.

See also: How can I incrementally date photos?

StarGeek
  • 3,803
  • 11
  • 21