View Full Version : PerlMagick Issues

01-02-2006, 12:29 AM
Greetings --

I am having troubles getting a very simple PerlMagick script to execute. After reading other posts on this forum, it does not appear that anyone has been successful with this. I spent some time with Tech Support this evening, and they did knock down some barriers that were mentioned in other posts (like the Magick.so error).

Here is my simple Perl script:

use Image::Magick;

my($image, $x);

$image = Image::Magick->new;
$x = $image->Read('test.jpg');
$x = $image->Crop(geometry=>'100x100+100+100');
$x = $image->Write('testNew.jpg');

It produces the error:

perl: magick/geometry.c:1138: SetGeometry: Assertion `image->signature == 0xabacadabUL' failed.

If I do a simple 'convert' from the command line, ImageMagick works great. If I go back into my script and comment out the 'Crop' and 'Write' commands, I get no errors - this implies that PerlMagick is installed correctly. However, if either of these commands are in the script, game over - I get the same error produced above. Finally, if I run this on my local machine with my own PerlMagick setup, everything works great - this implies that my script has no errors.

Has anyone had any success getting PerlMagick to work?

Thanks in advance for any advice you can offer.

-- Bob

01-08-2006, 09:45 PM
Greetings --

In case anyone else is reading this thread, I have made some progress on this issue. This strange assertion error occurred because the automatic installation of ImageMagick (and hence PerlMagick) via the Site Manager was *not* functioning properly. WestHost changed their installation script, and the sample scripts above now function properly.

WH's suggestion after I brought this to their attention (and they made some changes) was to uninstall and reinstall ImageMagick from the Site Manager. This worked on my domain, but I design websites for several of my clients that are hosted by WH, and the ImageMagick installation from their Site Managers simply fails now for their accounts. I think WH may have inadvertantly broken their own installation script.

Bottom line ... if you run into the error mentioned above or if your Site Manager refuses to re-install ImageMagick, contact Tech Support, and they can fix your domain on a case-by-base basis. It appears that WH does not have a global fix yet.

Hope this helps somebody out there ... ;)

-- Bob

01-09-2006, 05:05 PM
Thanks for the update Bob. I have been haveing some problems with Site Manager recently on some of my accounts. I have a feeling it may be more then just ImageMagick. Hopefully someone from WH will chime in on this and have a comment. :)

WestHost - SHales
06-18-2006, 06:52 PM
One thing to note if the Perl module of ImageMagick is not working is the following:
$ ldd /usr/local/perl/lib/site_perl/5.8.7/i686-linux/auto/Image/Magick/Magick.so
/lib/libsphera.so.1 => /lib/libsphera.so.1 (0x4002d000)
libMagick.so.9 => not found
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40055000)
libpng.so.2 => /usr/lib/libpng.so.2 (0x40074000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x40098000)
libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x400a8000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x401c0000)
libm.so.6 => /usr/lib/libm.so.6 (0x401f3000)
libc.so.6 => /usr/lib/libc.so.6 (0x40216000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x40355000)
libz.so.1 => /usr/lib/libz.so.1 (0x4035a000)
libiconv.so.2 => /usr/local/phplibs//lib/libiconv.so.2 (0x40368000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

If you see that the libMagick.so.9 results in a 'not found', it will need to be installed into your /usr/lib folder (which you have access to) for the module to function properly. Tech support is fully able to install this for you, or if you can find a copy yourself, placing it in that directory should enable you to use it. After doing so and running the above command again, you'll see the following:

$ ldd /usr/local/perl/lib/site_perl/5.8.7/i686-linux/auto/Image/Magick/Magick.so
libMagick.so.9 => /usr/lib/libMagick.so.9 (0x40050000)

Stephen Hales

WestHost Support Department
Phone: 1-800-222-2165
FAX: 435-755-3449

When you expect more from your web host