On 05/02/00, "Ned Konz <[EMAIL PROTECTED]>" wrote:
> [EMAIL PROTECTED] wrote:

> > Are there any Perl module(s) available that would allow me to determine the
> > information on the images programatically (size in pixels, resolution in bits
> > per inch and such like), so that I could select the most appropriate image (they
> > are often stored in more than one resolution)

That's one thing. Your message is titled "obtain information .. from graphics files."

There's the module Image::Size which would likely be the first choice to fit this part 
of what you need, but there is another module also, still in alpha, named Image::Info 
(Gisle Aas is the author). No I don't think you'll find it on ppm but check anyway (I 
don't have time right now). FYI however I run NT and I am using Image::Info. It gives 
you more information about your graphics files than Image::Size can do, including bit 
depth, resolution, compression level, comments, etc etc. It works pretty well even for 
being alpha code, for me. Supports: PNG, JPEG, GIF, TIFF (at least).

> > and if necessary re-size it to fit neatly.

That's a second thing, your message asked about info, not *editing* image files which 
in essence is what you ask for here. The recommendation to use ImageMagick (aka Perl 
Magick aka Image::Magick aka [ppm] Image-Magick) is fine but its a big mod with a big 
learning curve and although i have been messing with it for months I still find it 
buggy and not able to do many things that I think it should do according to its badly 
written documentation. If you want to mess with I-Magick you'll be in the Big Leagues.

> Image::Size is one I've heard of (though not used). The GD library
> offers a number of functions, as well, and (I believe) later versions support
> JPEG files as well as .PNG.
> 
> And Image::Magick provides an interface to those libraries, but perhaps
> this works only under Unix/Linux systems.

Ned, this is misleadingly stated. Image Magick is its own thing, not an interface to 
GD libraries. It has its own libraries (actually an extensible and sprawling list of 
potential features provided by options that it terms "delegates"). "GD.pm" is a 
simpler and completely separate (and important) Perl module that concentrates on 
dealing with palette images (colormapped images) and doesn't do Truecolor. The order 
in which one should insert oneself into the Swamp is thus:
1) Image::Size
2) Image::Info
3) GD.pm
4) Image::Magick

There's large squirmy unpleasant crawlies in there the deeper one goes, programmers 
beware.

ImageMagick has been "ported" to Win32, it will install "PerlMagick" and the binary 
applets ("convert.exe", "mogrify.exe" etc.) to a Windoze computer. Whether you'll 
discover that you have full functionality or not is another story. Specifically to 
start with you'll have no X interaction (unless you are one of the rare people who 
runs an X on Win32).

GD as we know from endless redundant newbie inquiries on this List, is on ppm.

   HTH,
     soren andersen
--
Tips, Info on Perl + PNG and other graphics processing available at:
http://www.wonderstorm.com/techstuff/
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to