Hello,

I have just compiled and installed ImageMagick-6.3.2
on a rehat machine (2.6.10-justin, i386). I then did
the same for PerMagick. This process appeared to
complete without errors, and /usr/local/bin/convert
seems to work.

But, using the attached CGI script below in a browser,
I get the following error:

Image Magick test Died: Can't load
'/usr/lib/perl5/site_perl/5.8.3/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.3/i386-linux-thread-multi/DynaLoader.pm
line 229. at (eval 1) line 2 

Both the "Magick.so" and "DynaLoader.pm" files do
exist. 

Can anyone please give guidance on how I can
troubleshoot this? 

Thanks much in advance.

- Stefan

#!/usr/bin/perl
#Test image magick

use strict;

$| = 1;
print "Content-type: text/html\n\n";
$SIG{__DIE__} = sub { print "Died: @_\n"; exit; };

print "<br>Image Magick test\n";

eval "use Image::Magick";
if ($@) { die "cannot load Image::Magick : [EMAIL PROTECTED]"; }
print "<br>Image Magick loaded\n";

my $ver = $Image::Magick::VERSION;
print "<br>Version detected is '$ver'\n";

print "<hr>\n<b>Trying to resize 'gif' image</b><br>";
&resizeImage("/listman/test_im.gif", "test_im_t.gif");

print "<hr>\n<b>Trying to resize 'jpg' image</b><br>";
&resizeImage("/listman/test_im.jpg", "test_im_t.jpg");

print "<hr>\n";
exit;

# -----------------------------------------------------------------------------
# Function    : resizeImage
# Description : try to resize an image with the ImageMagick module
# Usage       : &resizeImage($inputFile, $outputFile);
# -----------------------------------------------------------------------------

sub resizeImage {
  my $in_filename  = shift || die "no input image file specified!";
  my $out_filename = shift || die "no output image file specified!";

  # error checking
  unless (-f $in_filename) { die "input file: '$in_filename' hasn't been 
uploaded!"; }

  ### read file
  my $image = Image::Magick->new;
  my $msg = $image->Read($in_filename);
  print "Image read ($in_filename):\n";
  if ($msg) { die $msg; }
  print "<br><img src='$in_filename'>\n";

  ### get info
  my ($width,$height) = $image->Get('width','height');
  print "<br>Image size: width=$width height=$height\n";

  ### resize file
  $msg = $image->Resize( width => $width/2, height => $height/2 );
  print "<br>Image resized:\n";
  if ($msg) { die $msg; }
  my ($width,$height) = $image->Get('width','height');
  print "<br>Image size: width=$width height=$height\n";

  ### write file
  my @blob = $image->ImageToBlob();  # get the native, file-writable form of 
the image
  local *FILE;
  open(FILE,">$out_filename") or die "can't open outfile $out_filename for 
write: $!\n";
  binmode(FILE);
  print FILE $blob[0];                         # simple images only occupy one 
slot in blob
  close(FILE) or  die "can't close outfile $out_filename: $!\n";
  print "<br>Image written ($out_filename)\n";
  print "<br><img src='$out_filename'>\n";

}

# -----------------------------------------------------------------------------

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to