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.
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
for> do
for> exiv2 ad -a -6:43 $i
for> done
and the work is done. Simple. Powerful. I love it.