PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
# Open the inputImage for reading
my $inputImage = Image::Magick->new;
my $status = $inputImage->Read($filePath) or die;
print "$file status $status\n";
The script dies at the die statement. If I remove the die, $status is an empty string - no return code.
$filePath contains a valid path to my JPG image, no spaces or funny characters. Permissions on the JPG are world-readable. Any ideas?
To follow up, if I change my die to die $! the given error is "No such file or directory".
However, I am absolutely 100% sure that the path and permissions are correct, since the $filePath variable is used in an earlier call to read some EXIF data from the JPG. This works fine.
The usual suspect for odd permissions issues is SELinux, but this is disabled on my system. Any ideas?
The first command worked, and wrote out a logo. The second command failed with the same "no such file" message.
I presume the Read() call can take a whole path like Read("/home/jonathan/Pictures/logo.pnm") rather than having to cd and then calling Read("logo.pnm") ?
The most likely cause is that there is a structure mismatch between ImageMagick and PerlMagick. Try reinstalling both ImageMagick and PerlMagick so that they are built against the same version of ImageMagick or try downloading the PerlMagick source and build and install.
It isn't really practical to recompile from source since it will be overwritten at next package update, and I can't remove the packages because they are required by other packages on the system. Is there any other workaround?
Any reason why you can't install in /usr/local/? If that's not a problem, type:
sudo yum install ImageMagick-devel
wget ftp://magick.imagemagick.org/pub/ImageM ... -6.tar.bz2
bunzip2 -c ImageMagick-6.6.7-6.tar.bz2 | tar xvf -
cd ImageMagick-6.6.7-6
./configure
make
make install
cd PerlMagick
perl Makefile.PL
make install
I'm using Perlmagick. it is working fine in my windows.
but I'm unable to write a code in such a way that the "code asks user to enter the filename of his interest"
instead of reading the filename that is mentioned in the code.
# Open the inputImage for reading
my $inputImage = Image::Magick->new;
my $status = $inputImage->Read($filePath) or die;
print "$file status $status\n";
The script dies at the die statement. If I remove the die, $status is an empty string - no return code.
$filePath contains a valid path to my JPG image, no spaces or funny characters. Permissions on the JPG are world-readable. Any ideas?
Cheers,
Jonathan
can you please tell me on how you are going to write the path in "$filepath".