Align timestamps of photo-files

Started Sep 1, 2014 | Discussions thread
Shop cameras & lenses ▾
ForumParentFirstPrevious
Flat view
vojern Regular Member • Posts: 100
Align timestamps of photo-files

My Samsung smart TV (2013) displays photos in a chronological way, based on the timestamps of the jpg's. However, because of postprocessing, some photos have a later timestamp then others, while they have been taken earlier. A bit irritating...

In order to fix this, I have created a script for the bash commandline in linux to fix this. It takes a given date and time and adds one second to each photo. It assumes that the files come from one camera, where the filenumbers are ascending accoring to the time they have been made. The date in the script has to be adjusted for what you want yourself (it currently starts at 2014-08-21 at 12.00).

#!/bin/bash
sec=1
min=1
for photofile in *.*
do
echo $photofile " recieves a timestamp of 20140821120$min.$sec"
if [ $sec -gt 9 ]
then
touch -t 20140821120$min.$sec "$photofile"
else
touch -t 20140821120$min.0$sec "$photofile"
fi
sec=$[sec+1]
if [ $sec -gt 59 ]
then
min=$[min+1]
sec=1
fi
done

If some has a Windows-script for this, I would welcome it, as I use Windows for photo-editing.

ForumParentFirstPrevious
Flat view
ForumParentFirstPrevious
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow