Adding dates to your photos.

Add date in the photograph with a perl script.

#!/usr/bin/perl

if ($#ARGV < 0 )
{
print \”$#ARGV \\n\”;
print \”Usage $ARGV[0] filename/dir\\n\”;
exit -1;
}

@files = `find \”$ARGV[0]\” -iname \”*jpg\” -print`;

if ($#ARGV > 3 ) { $cmd = 1;}
$count = 1;
foreach $file (@files) {
chomp ($file);

@details = `exif1 \’$file\’`;

$flag = 1;
$flag2 = 0;
$flag_w = 0;
$date = \”\”;
foreach $det (@details) {
@words = split(/–>/, $det);
$_ = $det ;
chomp($words[1]);
if (/Date/ ) {
$date =$words[1] ;
$flag = 0;
}
}

if ($flag) {
@details = `exiftool \’$file\’`;
foreach $det (@details) {
@words = split(/ : /, $det);
$_ = $det ;
chomp($words[1]);
if (/Date\\/Time Original/ ) {
$date =$words[1] ;

}
}
}
system(\”annotate \”$date\” \”$file\” \”$file\”\”);

$count ++;
}