What I'm trying to do is pull the iptc data from an image using imagemagick.
I can read the image, display the image, etc. but for some reason I just can't find any info on how to read and display the iptc to the screen.
Here is something I found through several searches and modified to do what I thought would work:
#!/usr/bin/perl
#
use strict;
use warnings;
use Image::Magick;
# ---------------------------------------------------------
chdir('f:/cgi-bin') ¦¦ die("Can't chdir(f:/cgi-bin): $!");
my($input_file_name)= '0032.jpg';
my($image)= Image::Magick -> new();
my($result)= $image -> Read($input_file_name);
die $result if $result;
print "Reading: $input_file_name. \n\n";
my $profile = 'iptc';
print "Trying to write profile: $profile \n\n";
$result = $image -> Write("$profile:$input_file_name:-");
if ($result)
{
print "Error: $result. \n";
}
else
{
print "Wrote: $profile:0032.jpg \n";
}
What I get is:
Trying to write profile: iptc
Wrote: iptc:0032.jpg
Is there some setting that I'm missing? It seems like the data should fall between the two output lines. I know the data is there because I put it there with PhotoShop. Any ideas?
* I just noticed that the line "Reading: $input_file_name. \n\n" isn't printing. Could this be a clue?