Trying to get PerlMagick to work
Posted by: deke
Posted on: 2002-10-27 14:58:00
Does anyone have any suggestions on how to install PERL modules in our own webspace?
Clear back in May 2001, I asked Dreamhost how much they would charge me to install ImageMagick and PerlMagick on my server. William replied that they were already *on* the server.
But I can't seem to use it to resize images.
When I try to use the resize function, I get a message that "Resize.al" cannot be found on the INC path. The problem isn't the INC path, though, according to Nate. The problem is that I'm using a newer version of ImageMagick than they have on the server; I need to install my own version in my directory.
Fine. Except I *can't* figure out how.
ImageMagick and PerlMagick are both included in the RPM for ImageMagick. However, RPM doesn't work on Dreamhost's servers.
I obtained a binary of ImageMagick and loaded it into my directory. Then I got PerlMagick from CPAN and tried to install it as well.
It warns that you have to be *root* to install PerlMagick, but there is a workaround in the Perl manual. Well, the workaround says that you have to set command line arguments for the installation directory and the man pages directory. Tried it. I got a few errors. Well, 36K worth of errors, to be exact.
I asked support what I was doing wrong. Nate says I need to install a newer version of ImageMagick in my own directory. And what, might I ask, do I need to do besides put the binary there to *install* it? There aren't any instructions with the binary. And I can't go through the installation procedure in the RPM because, as I mentioned, the Dreamhost servers don't allow the use of RPMs.
Oh, yeah, and Nate says I'm supposed to tell PerlMagick to install against the newer version of ImageMagick instead of the one on the path. I had previously asked Nate about how you change the path, so that you could govern which executables were found first, and he said you need to do this within your perl scripts. But I haven't got that far yet - I'm still trying to get the makefile to run.
OK, so scrap that idea. Let's just use the existing version of ImageMagick. The ImageMagick Studio was able to do resizing back when DH2000 was released, and I was moved to my current server. Where can I find documentation for *that* version of PerlMagick.
Why, just type "man Image::Magick" on the command line.
Am I the only one who has trouble running man from a telnet session? All I can get is
> Magick(3pm) User Contributed Perl Documentation Magick(3pm)
>NAME
> Image::Magick - Perl extension for calling >ImageMagick's
> libmagick routines
>SYNOPSIS
> use Image::Magick;
> p = new Image::Magick;
> p->Read("imagefile");
> p->Set(attribute => value, ...)
> ($a, ...) = p->Get("attribute", ...)
> p->routine(parameter => value, ...)
> p->Mogrify("Routine", parameter => value, ...)
> p->Write("filename");
>DESCRIPTION
> This Perl extension allows the reading, manipulation and
> writing of a large number of image file formats using the
> magick library from ImageMagick by John Cristy
> (magick@wizards.dupont.com). It was originally developed
> to be used by CGI scripts for Web pages.
Maybe *you* call that documentation, but I can't figure out how to resize images with that. Which of these calls would be right? Are *any* of them correct?
p->Set(x=200 y=300);
p->Set(height=200 width=300);
p->Set("x"=200 "y"=300);
p->Set("height"=200 "width"=300);
p->Set(down=200 across=300);
p->Set("down"=200 "across"=300);
p->Set(rows=200 cols=300);
p->Set("rows"=200 "cols"=300);
p->Mogrify(resize, x=200 y=300);
p->Mogrify(resize, "x"=200 "y"=300);
p->Mogrify(resize, height=200 width=300);
p->Mogrify(resize, "height"=200 "width"=300);
p->Mogrify(resize, down=200 across=300);
p->Mogrify(resize, "down"=200 "across"=300);
p->Mogrify(resize, rows=200 cols=300);
p->Mogrify(resize, "rows"=200 "cols"=300);
p->Mogrify("resize", x=200 y=300);
p->Mogrify("resize", "x"=200 "y"=300);
p->Mogrify("resize", height=200 width=300);
p->Mogrify("resize", "height"=200 "width"=300);
p->Mogrify("resize", down=200 across=300);
p->Mogrify("resize", "down"=200 "across"=300);
p->Mogrify("resize", rows=200 cols=300);
p->Mogrify("resize", "rows"=200 "cols"=300);
p->Mogrify(shrink, x=200 y=300);
p->Mogrify(shrink, "x"=200 "y"=300);
p->Mogrify(shrink, height=200 width=300);
p->Mogrify(shrink, "height"=200 "width"=300);
p->Mogrify(shrink, down=200 across=300);
p->Mogrify(shrink, "down"=200 "across"=300);
p->Mogrify(shrink, rows=200 cols=300);
p->Mogrify(shrink, "rows"=200 "cols"=300);
p->Mogrify("shrink", x=200 y=300);
p->Mogrify("shrink", "x"=200 "y"=300);
p->Mogrify("shrink", height=200 width=300);
p->Mogrify("shrink", "height"=200 "width"=300);
p->Mogrify("shrink", down=200 across=300);
p->Mogrify("shrink", "down"=200 "across"=300);
p->Mogrify("shrink", rows=200 cols=300);
p->Mogrify("shrink", "rows"=200 "cols"=300);
I'm getting *awfully* frustrated here. I don't mind being told to RTFM, but there doesn't seem to *be* an F manual....