in reply to jpg file demensions

You might want to use the Image::Magick module to get the dimensions, and even to resize them.

Caution: Contents may have been coded under pressure.