Echoes Corsac.net - Echoes camshot
jeudi 30 novembre 2006 (1 post)
Ok so, I was there, trying to assemble pictures taken at my sister's birthday. I have my pictures, her boyfriend's pictures, both have more or less the same date sor pictures have the same timestamp. Then comes another friend, which camera isn't at all at the same time. It's +/- 6:43 hour lead. And there is the mess, because I want all those pictures sorted by time, so people looking at them doesn't have to sort them himself. He just clic "next" and the next photo appears, whoever has taken it.

Now, I want my pictures sorted by time and gallery knows how to extract the time for EXIF tags, so I don't have to set the modification time of the files accordingly. But what to do when even EXIF tags are wrong ? I just discovered exiv2 adjust option, which does exactly what I want. From the manpage:

ad | adjust
Adjust EXIF timestamps by the given time. Requires option -a
time.

-a time
Time adjustment in the format [-]HH[:MM[:SS]]. This option is
only used with the ’adjust’ action. Examples: 1 adds one hour,
1:01 adds one hour and one minute, -0:00:30 subtracts 30 secccc‐
onds.


So a simple loop accros those files:

corsac@hidalgo: for i in * [/tmp/gallery/arthur]
for> do
for> exiv2 ad -a -6:43 $i
for> done


and the work is done. Simple. Powerful. I love it.

Corsac@23:09:35 (Debian)

Images
Stats
  • 1526 posts
  • 7960 jours
  • 0.19 posts/jour
  • IRC
  • Last.fm
Stuff
Tech
Weblogs
Desktop