if ($limit_img_size) { @image_urls = grep { my $this_url = $_; my $image = get($this_url); print "Getting size of image $this_url
"; my ($height, $width) = imgsize(\$image) or die "Error $!"; print "IMG $this_url is $height and $width
"; $height <= $max_height && $width <= $max_width && $height ne "" && $width ne "" } @image_urls; } push @found_images, @image_urls; }