PDA

View Full Version : [ubuntu] change modified date/time on photo files to match EXIF data?



activematrix
December 27th, 2009, 09:28 PM
Hi,
I am looking for some help creating a script to read exif data from photos and change the created or modified date/time to match said exif data. This script would have to be able to be given a folder, and it would go through all subfolders, and it would have to be able to handle multiple file types. I have exiftool installed, if that helps.

Thanks a million!
Chris

amac777
December 27th, 2009, 10:36 PM
Here is a script I use for something smilar. It only updates the .JPG's in the current directory, which is all I needed it to do. You may be able to modify it for your purposes.


#!/bin/bash

for f in *.JPG;
do
x=`exiftool -d '%c' -DateTimeOriginal $f`;
touch -d "`echo $x | sed 's/Date\/Time\ Original\ :\ //'`" $f;
echo $f;
done

wilbertvolkers
January 9th, 2012, 09:59 PM
Another possibility:

sudo apt-get install jhead
jhead -ft *.jpg

coffeecat
January 9th, 2012, 11:39 PM
Old thread. Closed.