Srini has asked for the wisdom of the Perl Monks concerning the following question:

Hi Experts,

I need to capture the width and height of a image (particularly eps extension) file.

I have used Image::Size module, but it is not supporting the "eps" extension format.

Could you please suggest anyone, what's the appropriate module for this requirement with some example?

Thanks in advance.

P. Srinivasan
  • Comment on Capture Height & Width of a Image (eps extension) file

Replies are listed 'Best First'.
Re: Capture Height & Width of a Image (eps extension) file
by marto (Cardinal) on Feb 27, 2008 at 10:25 UTC
Re: Capture Height & Width of a Image (eps extension) file
by zentara (Cardinal) on Feb 27, 2008 at 16:31 UTC
    I just found that it worked with Image::Magick.

    Output:

    GD-graph1.eps is 200x200 200 200 120068 PS
    The script I used is:
    #!/usr/bin/perl -w use Image::Magick; my $x = $ARGV[0]; my $image; $image = Image::Magick->new; $image->Read($x); my ($w,$h)= $image->Get('columns','height'); print $x,' is ',$w.'x'.$h,"\n"; #this is very inneficient memory wise, use Ping ($width, $height, $size, $format) = $image->Ping($x); print $width,"\n", $height,"\n" ,$size,"\n", $format,"\n";

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: Capture Height & Width of a Image (eps extension) file
by ambrus (Abbot) on Feb 27, 2008 at 11:42 UTC