[greenstone-users] GS 2.84 LINUX ImangMagick is not installed ERROR

From Belanger, Arthur
DateFri Apr 8 02:38:28 2011
Subject [greenstone-users] GS 2.84 LINUX ImangMagick is not installed ERROR
Hello all.

I recently installed GS 2.84 on an x86 Linux box (RHEL6)

I was using the PDFPlugin with the -convert_to pagedimg_jpg option. I received an error when running import.pl indicating that ImageMagick was not installed; the error came from /usr/local/Greenstone/bin/script/gsConvert.pl

I did not install the ImageMagick that came with the GS installation package because I already had a newer version on the system; the files are in the path.

I looked at the code in gsConvert.pl. On line 1042, the code calls the identify program which is part of ImageMagick to determine if it is there and checks the return code. gsConvert then checks the return code for a -1 or a 256. To see what was going on, I copied the relevant code to a perl script for testing. The results indicate that identify returns 256 if it is called with no parameters, the same code gsConvert is looking for as 'program not found'. If identify is called with a parameter, -version, for example, it returns 0.

I have included the test script below in case anyone else is having this problem. The output of this script on my system is:

Calling identify with no parameters...
RC = 256
*** ImageMagick is not installed, the convert utility is not available. Unable to convert PDF/PS to images
Calling identify with -version...
RC = 0
Image Magick is ok

So, I solved the problem by adding -version to the call to identify on line 1042 of gsConvert.pl.
Perhaps this change could me made in the distribution.

====================================
#!/usr/local/bin/perl -s
#
print "Calling identify with no parameters... ";
my $result = `identify 2>&1`;
print "RC = $? ";
if ($? == -1 || $? == 256) {
# Linux and Windows return different values for "program not found"
# ImageMagick is not installed, thus the convert utility is not available.
print STDERR "*** ImageMagick is not installed, the convert utility is not available. Unable to convert PDF/PS to images ";
}
else {
print "Image Magick is ok ";
}
print "Calling identify with -version... ";
$result = `identify -version 2>&1`;
print "RC = $? ";
if ($? == -1 || $? == 256) {
# Linux and Windows return different values for "program not found"
# ImageMagick is not installed, thus the convert utility is not available.
print STDERR "*** ImageMagick is not installed, the convert utility is not available. Unable to convert PDF/PS to images ";
}
else {
print "Image Magick is ok ";
}
==================================
--
Arthur Belanger
Medical Library System Manager
ITS Academic Media & Technology
Yale University
PO Box 208065
New Haven, CT 06520-8065

(203) 785-6928
(203) 785-5636, fax

mailto:Arthur.Belanger@Yale.Edu
http://www.yale.edu/its/about/amt
http://info.med.yale.edu/library


NOTE: Yale ITS will NEVER request passwords or other personal information via email. Messages requesting such information are fraudulent and should be deleted.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://list.scms.waikato.ac.nz/mailman/private/greenstone-users/attachments/20110407/5905842f/attachment-0001.html