Changeset 23236 for main


Ignore:
Timestamp:
2010-10-27T15:22:29+13:00 (13 years ago)
Author:
ak19
Message:

Needed to set up Imagemagick (and GhostScript) for the remote server in parallel to what setup.bash does. Otherwise the client-GLI wasn't able to get the server to, for instnace, generate thumbnails when thumbnail generation was turned on. Thanks to Xiao Hu for bringing this to our notice through the mailing list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/cgi-bin/gsdlCGI.pm

    r23196 r23236  
    473473    &util::envvar_prepend("PATH",$gsdl_bin_os);
    474474   
     475    # set up ImageMagick for the remote server in parallel to what setup.bash does
     476    my $magick_home = &util::filename_cat($gsdl_bin_os,"imagemagick");
     477    if(-e $magick_home) {
     478    my $magick_bin = &util::filename_cat($magick_home,"bin");
     479    my $magick_lib = &util::filename_cat($magick_home,"lib");
     480
     481    &util::envvar_append("PATH", $magick_bin);
     482
     483    if(!defined $ENV{'MAGICK_HOME'} || $ENV{'MAGICK_HOME'} eq "") {
     484        $ENV{'MAGICK_HOME'} = $magick_home;
     485    }
     486   
     487    if($gsdlos eq "linux") {
     488        &util::envvar_prepend("LD_LIBRARY_PATH", $magick_lib);
     489    } elsif ($gsdlos eq "linux") {
     490        &util::envvar_prepend("DYLD_LIBRARY_PATH", $magick_lib);
     491    }
     492
     493    }
     494
     495    # set up GhostScript for the remote server in parallel to what setup.bash does
     496    my $ghostscript_home = &util::filename_cat($gsdl_bin_os,"ghostscript");
     497    if(-e $ghostscript_home) {
     498    my $ghostscript_bin = &util::filename_cat($ghostscript_home,"bin");
     499    &util::envvar_prepend("PATH", $ghostscript_bin);
     500
     501    if(!defined $ENV{'GS_LIB'} || $ENV{'GS_LIB'} eq "") {
     502        $ENV{'GS_LIB'} = &util::filename_cat($ghostscript_home,"share","ghostscript","8.63","lib");     
     503    }
     504    if(!defined $ENV{'GS_FONTPATH'} || $ENV{'GS_FONTPATH'} eq "") {
     505        $ENV{'GS_FONTPATH'} = &util::filename_cat($ghostscript_home,"share","ghostscript","8.63","Resource","Font");
     506    }
     507    }
     508
    475509    # If the "perlpath" property is set in the gsdl(3)site.cfg config file, it is
    476510    # prepended to PATH only if the same perl bin dir path is not already on PATH env
Note: See TracChangeset for help on using the changeset viewer.