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

Is it possible to find out the embedded image resolution in illustrator file using perl?

Replies are listed 'Best First'.
Re: Embedded image resolution?
by zentara (Cardinal) on Mar 09, 2009 at 13:47 UTC
    I don't know about Illustrator, or whether you need to extract or convert the images.

    You might try the efficient "ping" method of Image::Magick, if you can get at the image.

    #!/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";
    OR Image::Size
    #!/usr/bin/perl use strict; use warnings; use LWP::Simple; use Image::Size; my $url = 'YOUR URL HERE'; my $img = get($url); my ($width, $height) = imgsize(\$img); print "$url is ${width}x${height}\n";

    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
Re: Embedded image resolution?
by Anonymous Monk on Mar 09, 2009 at 13:24 UTC
Re: Embedded image resolution?
by Gavin (Archbishop) on Mar 09, 2009 at 18:23 UTC