#!/usr/bin/perl -w use strict; use Image::Size; ($x, $y) = imgsize("path/to/yourfile.jpg");