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

This IS perl related even though it may not seem that way at first. My webhost says ImageMagick is installed but ALL my scripts with use Image::Magick fail. I told them this countless times but they say it's there. Fail meaning it says "Cannot find ImageMagick.."

They have this folder that's /home/myname/lib/Convert they said to use. And I tried using this as a use lib ""; but it can't find Image::Magick. Then he emailed me back saying Convert EQUALS ImageMagick and I don't know what the heck he's talking about.

Anyone know what Convert is or if it's ImageMagick? I know this is a pain in the butt package, but is it possible to install on my own to use? Just by uploading it in my own lib folder?

Replies are listed 'Best First'.
Re: ImageMagick on the webhost
by b10m (Vicar) on Mar 11, 2004 at 18:36 UTC

    convert (usually written with lowercase "c") is a binary that uses the ImageMagick libraries. Image::Magick, what you are refering to, is a Perl module. Assuming that you are on some *NIX system, you could always try the following, to see what a file exactly is:

    $ file /home/myname/lib/convert

    To make sure that Image::Magick -the module- is around, just hit:

    $ locate Magick.pm # or $ find / -name Magick.pm

    Update: since the ImageMagick libraries are most likely installed on the system, you can put the Image::Magick module in your $HOME or somewhere and call it with use lib;. There are many nodes around that'll show you how to install modules in a non-default place.

    --
    b10m

    All code is usually tested, but rarely trusted.
      I installed the one module you said Magick.pm and added that to my /lib/. I get the error
      Can't locate loadable object for module Image::Magick in @INC (@INC co +ntains: /home/name/public_html/lib /usr/lib/perl5/5.8.0/i386-linux-th +read-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-l +inux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_ +perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/li +b/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at check.pl l +ine 13 Compilation failed in require at check.pl line 13. BEGIN failed--compilation aborted at check.pl line 13.
      Did I do something wrong?

        Brother tachyon wrote a fine tutorial (A Guide to Installing Modules). I could partially quote it here, but it's better to read the whole thing :)

        --
        b10m

        All code is usually tested, but rarely trusted.
      Is there a way to use convert itself in my script that requires the module?
Re: ImageMagick on the webhost
by Corion (Patriarch) on Mar 11, 2004 at 18:41 UTC

    The program convert is part of the ImageMagick package, and you could use it as a substitute if the PerlMagick glue between the ImageMagick C library and Perl is not available, but you will have to change your scripts to use system() calls to the convert program (possibly as /home/myname/lib/Convert/convert and pass the correct commandline parameters.

    Installing your own PerlMagick library is possible in theory but hard in practice if you didn't compile the Perl to use it yourself.

    To get PerlMagick working, you need to download the ImageMagick package, compile it with the same C compiler used to compile the Perl on your webhosting server. Then also use that C compiler to compile the PerlMagick package Image::Magick. After that, upload all relevant binary files to your webhost into the right directories, which will also need some experimentation and still carries the potential for failure, depending on the OS used as server OS.

    If you don't trust your webhosting service, ask them to provide the output of the test suite of PerlMagick (make test during the installation of PerlMagick).