|
I know it is an old post but I came across it while having the same problem. While there are some difficulties on *nix, it is possible on Win32. Here is a tiny perl script that fixes file creation date in current directory:
use Win32API::File::Time qw{:win};
use Image::ExifTool qw(:Public);
use Date::Parse;
opendir(DIR, ".");
@files = readdir(DIR);
close(DIR);
foreach $file (@files) {
next if $file !~ /.+\.jpe?g$/;
my $tag = "CreateDate";
$values = ImageInfo($file, $tag);
$value = $$values{$tag}; # can be a different name !!!
# http://search.cpan.org/~exiftool/Image-ExifTool-8.50/lib/Image/ExifTool.pod#ImageInfo
print "Setting $file file creation date to $value\n";
$time = str2time($value);
if (! SetFileTime($file, undef, undef, $time) ) {
warn "Error occured: $^E\n";
}
}
print "Done!\n"; |