Forum Moderators: coopster & phranque

Message Too Old, No Replies

Image::Size alternatives

Need something else that does the same thing.

         

molecularr

6:25 pm on Dec 2, 2004 (gmt 0)

10+ Year Member



Hi everyone.

I've run into a problem whereby I need to make perl read a bunch of images and return their width and height in a pair of values. I found the Image::Size module, but I don't have root access and my admin doesn't want to install it. I need to either find out if there's a way to install it locally or (better yet) if there's a lighter-weight alternative. Any suggestions?

I don't even mind doing it "the long way", but my Perl's not that great, so that would take a long time and I need this today.

If you can think of anything, please let me know.

M

moltar

6:33 pm on Dec 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Image::Size is the most lightweight alternative that I know of.

You can easily install almost any module yourself.

Place Image::Size dir in the same dir as your script and it will work fine in most cases.

If it still does not work, add this to the begining of your script.

use lib './';

So you tree should look something like this:


yourscript.pl
Image
¦_ Size.pm

molecularr

7:57 pm on Dec 2, 2004 (gmt 0)

10+ Year Member



moltar -- That make sense, and it's basically what I tried, but I couldn't figure out how to tell install to put it in the local directory instead of /opt/perl or wherever perl lives on my server.

This is my first time trying to install a module, so I'm just following the readme instructions which tell me to

perl Makefile.PL
make && make test

Which works fine. Then the next step:

make install

starts up fine but dies on a series of "you don't have access to where perl lives"-type messages. I assume there's some kind of flags I can use (I looked at man install but didn't see anything obvious), but I'm afraid to use them when I really don't know what I'm doing unix-wise.

So what do I do?

molecularr

9:34 pm on Dec 2, 2004 (gmt 0)

10+ Year Member



Oops, nevermind:

> perl Makefile.PL PREFIX=/directory_you_want_to_put_it_in.

It works now. Thanks for the suggestion, moltar.

moltar

5:01 am on Dec 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The thing is, you don't even need the install for most of the scripts, only in some very rare and complex modules that you need that. Most of the time you can just copy the file straight from the archive or your local computer to the server and it will work. After all it's the same perl code in the module, and perl supposed to be cross-platform.