Changeset 24600 for main/trunk/greenstone2/bin/script
- Timestamp:
- 2011-09-15T16:31:11+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2/bin/script
- Files:
-
- 1 added
- 3 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"; -
main/trunk/greenstone2/bin/script/pdfpstoimg.pl
r17328 r24600 88 88 # with quoting when GSDLHOME might contain spaces) but assume 89 89 # that the PATH is set up correctly. 90 $cmd = " convert";90 $cmd = "\"".&util::get_perl_exec()."\" -S gs-magick.pl convert"; 91 91 92 92 my $output_filename = &util::filename_cat($output_filestem, $input_basename); … … 100 100 # note we return 0 if the file is "encrypted" 101 101 $!=0; 102 if (system($cmd)!=0) { 102 my $status = system($cmd); 103 if ($status != 0) { 103 104 print STDERR "Convert error for $input_filename $!\n"; 104 105 # leave these for gsConvert.pl... -
main/trunk/greenstone2/bin/script/pdftohtml.pl
r7643 r24600 249 249 $cmd = "pnmtopng \"${directory}$image\" > \"${directory}$image_base.png\" 2>/dev/null"; 250 250 if (system($cmd)!=0) { 251 $cmd = " convert \"${directory}$image\" \"${directory}$image_base.png\" 2>/dev/null";251 $cmd = "\"".&util::get_perl_exec()."\" -S gs-magick.pl convert \"${directory}$image\" \"${directory}$image_base.png\" 2>/dev/null"; 252 252 if (system($cmd)!=0) { 253 253 print STDERR "Cannot convert $image into PNG format (tried `pnmtopng' and `convert')...\n";
Note:
See TracChangeset
for help on using the changeset viewer.