in reply to Re: How can I get image height and width without using Image::Size?
in thread How can I get image height and width without using Image::Size?

Why all those steps?

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

And yes, I also use Image::Size when available.


Enjoy, Have FUN! H.Merijn
  • Comment on Re: Answer: How can I get image height and width without using Image::Size?
  • Download Code

Replies are listed 'Best First'.
Re^2: Answer: How can I get image height and width without using Image::Size?
by Tux (Canon) on Jun 26, 2007 at 09:32 UTC

    This of course does not work for files that are called My pic of a 4x4 car.jpg :)

    But identify has options!

    my ($x, $y) = (`identify -format "%w,%h" -quiet $image_file` =~ m/(\d+)/g);

    In whatever prefered context or style.


    Enjoy, Have FUN! H.Merijn