Image Magick, perl- Can't get working

Hi I just tried to install Image Magick to shrik some images, but I get the following error when I try to run my perl script?
Does anyone have any suggestions?

thank you
Steve


Can't load '/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagick.so.10: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/DynaLoader.pm line 230.
 at ./reize.pl line 4
Compilation failed in require at ./resize.pl line 4.
BEGIN failed--compilation aborted at ./resize.pl line 4.

------------------code below-------------------------------------------------

#!/usr/bin/perl
use strict;
use warnings;
use Image::Magick;  #this is the line the error occurs at



my $path = glob("./");

my @pageName = ();
opendir(DIR,$path) or die "can't open dir $!";
my @files = grep{/\.bmp|.JPG$/} readdir(DIR);
closedir(DIR);


my $image = Image::Magick->new();  #contains an image
foreach $image_file (@files){


    $image->Read($image_file);
    $image->Resize(geometry => '120x90');
    $image->Write($image_file);
}
sai4Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
kblack05Connect With a Mentor Commented:
Steve,

I believe this link is what you'll need...

http://www.redhat.com/archives/fedora-package-announce/2006-May/msg00124.html

This update can be installed with the 'yum' update program.  Use 'yum update
package-name' at the command line.  For more information, refer to 'Managing
Software with yum,' available at http://fedora.redhat.com/docs/yum/.

yum imagemagick

If that installs for you, then run the perl -e commands again and see if you get the same error. Also useful is to open a second virtual terminal (ALT+F3 for example) and

tail -f /var/log/messages

Or even add this to the top of your perl script for some more verbose debugging.

Add the following snippet to your script, just beneath the shebang line (the first line of the script; usually !#/usr/local/bin/perl or !#/usr/bin/perl):

BEGIN {
open (STDERR, ">/path/to/somewhere/error.txt");
}

then after you run the perl script, you should have verbose logging in
/path/to/somewhere/error.txt

Post back if you have problems...
0
 
kblack05Commented:
What operating system are you using? ( I know Linux but flavor)

Try this. From command line on the server type

perl -e 'use Image::Magick;'

If you run that command and it comes back with no errors, the module is working. If the module errors, then use this command to install it:

perl -MCPAN -e 'install Image::Magick'

If installing the module fails, it's likely a software package missing (which with the shared .so config error above seems likely). At this point you use the package manager for whatever distribution you have to install Image Magick. For example on a Mandriva box it would be

urpmi ImageMagick

Also, if you have installed them, and you are still getting errors from Perl, post back and I  can provide you with more information.

Regards,

~K Black
0
 
sai4Author Commented:
hi K Black

perl -e 'use Image::Magick;'     gave me the same error

so I did
perl -MCPAN -e 'install Image::Magick'

got

Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
Going to read /home/steve/.cpan/sources/modules/03modlist.data.gz
Going to write /home/steve/.cpan/Metadata
Image::Magick is up to date.


I then tried


perl -e 'use Image::Magick;'   but it gave me  the same error


any suggestions?

Thank you
Steve

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
kblack05Commented:
Refer to previous post. You probably need to install core  components on the Operating System for ImageMagick. Which distro of Linux are you using? Then I can give you the steps to get it done.

0
 
sai4Author Commented:
Fedora Redhat 4

thank you
Steve
0
 
mjcoyneCommented:
I think you have the API (application programing interface) for ImageMagick (aka PerlMagick) installed, but you don't have the application it interfaces with (ImageMagick) installed.

See http://www.imagemagick.org/script/binary-releases.php#unix.
0
 
Dennis MaederCommented:
sai4,
You have installed IM as a non-root user and your perl is looking in the standard root installed location - so it is not found when you run perl.
D
0
 
Dennis MaederCommented:
This link shows the way to do cpan install as non-root user.
http://sial.org/howto/perl/life-with-cpan/non-root/
D
0
 
Dennis MaederCommented:
On a different note, ImageMagick is not always compatible with system libraries, and you may do better using GD.
See e.g. http://search.cpan.org/dist/GD/
D
0
 
jhurstCommented:
I would shell out to ImageMagick rather than perlMagic - this way you can test that all works well at the shell yourself rather than needing to wonder
0
 
jhurstCommented:
to me it seems clear with this type of thing that one of the solutions is being used and that the questioner has just forgotten to mention it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.