[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Determining Image Dimensions



On Fri, 29 Jan 1999 19:14:36 +0100, Matt Henderson wrote:

>Does anyone know if a Perl function has been written that can determine 
>the dimensions of a .jpg or .gif image file. I'd like to do the following:
>
>     ($height, $width) = get_image_size($my_image_path);

Again: yes. Look up the module Img::Size in CPAN (e.g. www.cpan.org).

You need to tweak it a little, to get it to work: first, as always,
replace Unix newlines with Mac CR's. Move the file "Size.pm" to a folder
"Img" in a folder that is in your @INC (see MacPerl's preferences
screen), for example "Lib" or "site_perl" in MacPerl's folder.

But, the script unnecessarily depends upon Autoload. You must remove the
mentions of this in the module, and remove the line "__END__" just below
sub img_eof(). That ought to do the trick. It has worked before.

	Bart.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch