Ignore:
Timestamp:
2011-09-15T16:31:11+12:00 (13 years ago)
Author:
ak19
Message:

Added gs-magick.pl script which will set the environment for ImageMagick (including LD_LIBRARY_PATH) before launching the requested ImageMagick command and arguments. By setting the Imagemagick environment from this script we ensure that the modified env variables don't create conflicts with libraries needed for normal linux execution. All the Greenstone files in the *binary* that made direct calls to imagemagick now go through this script. The affected files are perl files in bin/script and perllib and Gatherer.java of GLI. (wvware has files that test for imagemagick during compilation stage, which is independent of our changs which are only for users running imagemagick from a GS binary.) The final problems were related to how different perl files made use of the return values and the output of running their imagemagick command: they would query the 127 and/or and/or run the command with backtick operators to get the output printed to STDOUT. By inserting an intermediate gs-magick.pl file, needed to ensure that the exit code stored in 127 would at least be passed on correctly, as is necessary when testing the exit code against non-zero values or greater/less than zero (instead of comparing them with equals/not equal to 0). To get the correct exit code as emitted by imagemagick, calling code needs to shift bits in 127 and converting it to a signed value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/StructuredHTMLPlugin.pm

    r21801 r24600  
    3636use HTMLPlugin;
    3737use ImageConverter; # want the identify method
     38use util;
    3839
    3940use strict; # every perl program should have this!
     
    327328        my $command = "convert -interlace plane -verbose "
    328329        ."-geometry $newsize \"$img_filename\" \"$resized_filename\"";
     330        $command = "\"".&util::get_perl_exec()."\" -S gs-magick.pl $command";
    329331        #print $outhandle "ImageResize: $command\n" if ($verbosity > 2);
    330332        #my $result = '';
Note: See TracChangeset for help on using the changeset viewer.