- Timestamp:
- 2011-09-15T16:31:11+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/ImageConverter.pm
r24346 r24600 32 32 no strict 'refs'; # allow filehandles to be variables and viceversa 33 33 34 use util; 34 35 use gsprintf 'gsprintf'; 35 36 … … 131 132 $no_image_conversion_reason = "win95notsupported"; 132 133 } else { 133 my $result = `identify -help 2>&1`; 134 my $imagick_cmd = "\"".&util::get_perl_exec()."\" -S gs-magick.pl"; 135 my $result = `$imagick_cmd identify -help 2>&1`; 134 136 my $return_value = $?; 135 136 if ( ($ENV{'GSDLOS'} eq "windows" && $return_value == 256) || $return_value == -1) { # Linux and Windows return different values for "program not found" 137 138 # When testing against non-zero return_value ($?), need to shift by 8 139 # and convert it to its signed value. Linux returns -1 and Windows returns 140 # 256 for "program not found". The signed equivalents are -1 and 1 respectively. 141 $return_value >>= 8; 142 $return_value = (($return_value & 0x80) ? -(0x100 - ($return_value & 0xFF)) : $return_value); 143 144 if ( ($ENV{'GSDLOS'} eq "windows" && $return_value == 1) || $return_value == -1) { # Linux and Windows return different values for "program not found" 137 145 $image_conversion_available = 0; 138 146 $no_image_conversion_reason = "imagemagicknotinstalled"; … … 407 415 408 416 # Generate and run the convert command 409 my $convert_command = " convert -interlace plane -verbose $convert_options \"$source_file_path\" \"$target_file_path\"";417 my $convert_command = "\"".&util::get_perl_exec()."\" -S gs-magick.pl convert -interlace plane -verbose $convert_options \"$source_file_path\" \"$target_file_path\""; 410 418 411 419 my $print_info = { 'message_prefix' => $convert_id, … … 439 447 440 448 # Use the ImageMagick "identify" command to get the file specs 441 my $command = " identify \"$image\" 2>&1";449 my $command = "\"".&util::get_perl_exec()."\" -S gs-magick.pl identify \"$image\" 2>&1"; 442 450 print $outhandle "$command\n" if ($verbosity > 2); 443 451 my $result = '';
Note:
See TracChangeset
for help on using the changeset viewer.