in reply to getting the dimensions of a picture (jpeg)

i've written a bigger example in the node Re^2: Swimsuits2004, but to be short:
#!/usr/bin/perl -w use strict; use Image::Magick; my $file="path/to/yourfile.jpg" my $image = Image::Magick->new; $image->Read($file); my ($x,$y) = $image->Get('width', 'height');
Oops: no Image::Magic for you... Indeed use Image::Size, but it's not that powerfull:
#!/usr/bin/perl -w use strict; use Image::Size; ($x, $y) = imgsize("path/to/yourfile.jpg");

but for resizing i'd prefer Image::magic, but an alternative could be Image::Processor
another idea is to use the Gimp in Perl.
for the code below to work, refer to:Image size in pure perl, you need
sub sizeJPG { return unless $_[0]; my ($width, $height); ($height,$width) = unpack( "nn", $1 ) if $_[0] =~ /\xFF\xC0...(... +.)/; return ($width,$height); }