use Imager; my $image_source = $ARGV[0]; my $image = Imager->new; $image->read(file=>$image_source) or die "Cannot load $image: ", $image->errstr;