use Image::Size; ($x, $y) = imgsize("mypic.gif");