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
In reply to How to read Image Resolution on Mac OS X by Jouve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |