Changeset 24600 for main/trunk/greenstone2/bin/script/gsConvert.pl
- Timestamp:
- 2011-09-15T16:31:11+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/gsConvert.pl
r24513 r24600 824 824 # Check that ImageMagick is installed and available on the path (except for Windows 95/98) 825 825 if (!($ENV{'GSDLOS'} eq "windows" && !Win32::IsWinNT())) { 826 my $result = `identify 2>&1`; 827 if ($? == -1 || $? == 256) { # Linux and Windows return different values for "program not found" 826 my $imagick_cmd = "\"".&util::get_perl_exec()."\" -S gs-magick.pl"; 827 my $result = `$imagick_cmd identify 2>&1`; 828 829 # Linux and Windows return different values for "program not found". 830 # Linux returns -1 and Windows 256 for "program not found". But once they're 831 # converted to signed values, it will be -1 for Linux and 1 for Windows. 832 # Whenever we test for return values other than 0, shift by 8 and perform 833 # unsigned to signed status conversion on $? to get expected range of return vals 834 # Although gs-magick.pl already shifts its $? by 8, converts it to a signed value 835 # and then exits on that, by the time we get here, we need to do it again 836 my $status = $?; 837 $status >>= 8; 838 $status = (($status & 0x80) ? -(0x100 - ($status & 0xFF)) : $status); 839 if ($status == -1 || $status == 1) { #if ($status == -1 || $status == 256) { 828 840 #ImageMagick is not installed, thus the convert utility is not available. 829 841 print STDERR "*** ImageMagick is not installed, the convert utility is not available. Unable to convert PDF/PS to images\n";
Note:
See TracChangeset
for help on using the changeset viewer.