Jouve has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have written a Perl script that need to be executed on Mac OS X (version: 10.6.8) to read the image resolution using the below module.
Image::ExifTool qw(ImageInfo)
But I am not able to read the image Meta information. Kindly advise how to read the resolution of the images using Perl in Mac. Below is the code that I have used:
foreach my $eachImage (@Images) { my ($xrez,$yrez); $xrez=0; next if($eachImage !~ /\.(PNG|JPG|JPEG|TIFF|TIF|EPS|PSD)$/i); $info = ImageInfo("$Directory_Path\\$eachImage"); foreach (keys %$info) { my $val = $$info{$_}; my $imgres=$_."\t".$val."\n"; if ($imgres=~m/XResolution\t([0-9]+)/gi) { $xrez=$1; } } $xrez=sprintf("%.1f",$xrez); $sno++; if ($xrez < 300 or $xrez > 1200) { $result="Fail"; } else { $result="Pass"; } push @Report, $sno.'---'.$eachImage.'---'.$xrez.'---'.$result; undef $image; }
Note: The above script is working fine in Windows XP.
Please help to resolve this problem.
Thanks in Advance,
Sankar
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to read Image Resolution on Mac OS X
by MidLifeXis (Monsignor) on Oct 08, 2013 at 15:50 UTC | |
by Jouve (Initiate) on Oct 10, 2013 at 06:26 UTC | |
|
Re: How to read Image Resolution on Mac OS X
by frozenwithjoy (Priest) on Oct 08, 2013 at 15:51 UTC | |
by Jouve (Initiate) on Oct 10, 2013 at 06:30 UTC | |
|
Re: How to read Image Resolution on Mac OS X
by Laurent_R (Canon) on Oct 08, 2013 at 17:04 UTC |