Reading for just a single tag

Started by Archive, May 12, 2010, 08:54:24 AM

Previous topic - Next topic

Archive

[Originally posted by knighthawk on 2008-08-16 19:16:00-07]

Hi! I am new to Perl, and my programming knowledge is very limited (just 1 week). I'm trying to read specific tags to store in a text file, but I do not know the syntax. This is the code I found in the help file but it list the key pairs.
Code:
use Image::ExifTool qw;
my $exifTool = new Image::ExifTool;
my $info = $exifTool->ImageInfo('image.jpg');
foreach (keys %$info) {
    print "$_ => $$info{$_}\n";
}
For example, I may just need author name and the date taken, how would I gather this into variable $author and $date? I am yet to learn about the advanced part of programming, so this part of the code was above my head. :-(

Thanks in advance

Archive

[Originally posted by exiftool on 2008-08-17 14:30:10-07]

Try this:

Code:
my $author = $$info{Author};
 my $date = $$info{DateTimeOriginal};

- Phil

Archive

[Originally posted by knighthawk on 2008-08-22 13:11:24-07]

Thanks a ton Phil! https://exiftool.org/forum/Smileys/default/smiley.gif" alt="Smiley" border="0" />