On Fri, 18 Oct 2002 11:50:43 -0600, [EMAIL PROTECTED] (Matthew C.
Peterson) wrote:

>I am trying to find the dimensions of a graphic with perl. I have the
>PerlMagick (Image::Magick) module, but I'm not sure if that is what I need.
>My purpose is to find the dimensions of an image, then send the x and y
>through an algorithm that will determine the best size for a thumbnail.

You can use the ping method, it is more efficient than read.

#!/usr/bin/perl -w
use Image::Magick;

my $x = $ARGV[0];
my $image = Image::Magick->new;

#$image->Read($x);
#my ($w,$h)= $image->Get('columns','height');
#print $x,' is ',$w.'x'.$h,"\n";
#this is very inefficient memory wise, use Ping

($width, $height, $size, $format) = $image->Ping($x); 
print $width,"\n", $height,"\n" ,$size,"\n", $format,"\n";



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to