chomp (my $id = `identify $image_file`); my ($x, $y) = ($id =~ m/\s([0-9]+)x([0-9]+)\s/);