Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to fix incorrectly set EXIF datestamps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to fix incorrectly set EXIF datestamps
Authored by: merlyn on Mar 30, '04 12:22:13PM
Hmm. I wrote this little Perl script to do the same thing:

#!/usr/bin/perl
use strict;
$|++;

use Image::EXIF;
use Time::Local;

for (@ARGV) {
  my $exif = Image::EXIF->new($_) or next;
  my $info = $exif->get_image_info() or next;
  my $created = $info->{"Image Created"} or next;
  my @digits = $created =~ /(\d+)/g or next;
  $digits[0] -= 1900;
  $digits[1] -= 1;
  my $gmtime = timegm(reverse @digits);
  if ($gmtime > time or $gmtime < time - 86400*30) {
    warn "preposterous gmtime for $_", scalar gmtime;
    next;
  }
  utime($gmtime, $gmtime, $_) or warn "Cannot utime on $_: $!";
}
Requires Image::EXIF from the CPAN (install via perl -MCPAN -eshell).

Also note that I always keep my camera on GMT, because I never have to remember to set it that way. {grin}

[ Reply to This | # ]

Another option
Authored by: globeriding on Mar 30, '04 02:32:28PM
Another option is to check out an app called Photoinfo , which has a GUI for all us non UNIX heads. It's a great app, and the developer is very responsive- even emailed me a beta with a feature I needed to test.

[ Reply to This | # ]
How to fix incorrectly set EXIF datestamps
Authored by: MartySells on Mar 30, '04 08:11:40PM

This only fixes the file timestamps, not the EXIF version which makes sense if you always keep the EXIF ones pointing to GMT. Smart trick keeping the camera on GMT :) -m



[ Reply to This | # ]
How to fix incorrectly set EXIF datestamps
Authored by: MartySells on Mar 30, '04 08:14:47PM
By 'this' I meant merlyn's script. I checked out Image-EXIF on CPAN and don't see that it supports setting EXIF info. -m

[ Reply to This | # ]