in reply to finding jpeg pixel size

One way (not necessarily the best) is to use Image::MetaData::JPEG:
use Image::MetaData::JPEG; ( $w, $h ) = Image::MetaData::JPEG->new($fname)->get_dimensions;
We're building the house of the future together.