[greenstone-users] Thumbnails working fine from command line, failing with GLI

From Anupama of Greenstone Team
DateWed Oct 27 16:17:16 2010
Subject [greenstone-users] Thumbnails working fine from command line, failing with GLI
In-Reply-To (AANLkTinKwCp8UhJJiNrti-AgAEJg6jyts2-Zr2umWZAw-mail-gmail-com)
Hi Matt,

It looks like you are using a client-GLI as well, to connect to a remote
server. Is that right? If so, then I think the solution to your problem
may be similar to the one I sent off to Xiao Hu today. Will you try the
same (see below), and tell me if you have any further difficulties?


1. Open up the following file in a text editor:
<your server machine's Greenstone installation folder>/cgi-bin/gsdlCGI.pm


2. Look for the lines (use Ctrl-F in text editors on Windows) in
gsdlCGI.pm that say:

...
my $gsdl_bin_os = &util::filename_cat($gsdlhome,"bin",$gsdlos);
&util::envvar_append("PATH",$gsdl_bin_os);

# If the "perlpath" property is set in the gsdl(3)site.cfg config file,
it is
# prepended to PATH only if the same perl bin dir path is not already on
PATH env
my $perl_bin_dir = $self->get_perl_path($optional);
...


3. Now, in the empty line between, insert all the following lines.

# set up ImageMagick for the remote server
my $magick_home = &util::filename_cat($gsdl_bin_os,"imagemagick");
if(-e $magick_home) {
my $magick_bin = &util::filename_cat($magick_home,"bin");
my $magick_lib = &util::filename_cat($magick_home,"lib");

&util::envvar_append("PATH", $magick_bin);

if(!defined $ENV{'MAGICK_HOME'} || $ENV{'MAGICK_HOME'} eq "") {
$ENV{'MAGICK_HOME'} = $magick_home;
}

if($gsdlos eq "linux") {
&util::envvar_prepend("LD_LIBRARY_PATH", $magick_lib);
} elsif ($gsdlos eq "linux") {
&util::envvar_prepend("DYLD_LIBRARY_PATH", $magick_lib);
}

}


4. So your file would now contain the following:

...

my $gsdl_bin_script = &util::filename_cat($gsdlhome,"bin","script");
&util::envvar_append("PATH",$gsdl_bin_script);

my $gsdl_bin_os = &util::filename_cat($gsdlhome,"bin",$gsdlos);
&util::envvar_append("PATH",$gsdl_bin_os);

# set up ImageMagick for the remote server
my $magick_home = &util::filename_cat($gsdl_bin_os,"imagemagick");
if(-e $magick_home) {
my $magick_bin = &util::filename_cat($magick_home,"bin");
my $magick_lib = &util::filename_cat($magick_home,"lib");

&util::envvar_append("PATH", $magick_bin);

if(!defined $ENV{'MAGICK_HOME'} || $ENV{'MAGICK_HOME'} eq "") {
$ENV{'MAGICK_HOME'} = $magick_home;
}

if($gsdlos eq "linux") {
&util::envvar_prepend("LD_LIBRARY_PATH", $magick_lib);
} elsif ($gsdlos eq "linux") {
&util::envvar_prepend("DYLD_LIBRARY_PATH", $magick_lib);
}

}

# If the "perlpath" property is set in the gsdl(3)site.cfg config file,
it is
# prepended to PATH only if the same perl bin dir path is not already on
PATH env
my $perl_bin_dir = $self->get_perl_path($optional);

...


5. Save the file and close it in your editor.


6. Go back to a client-GLI and try to rebuild that image collection now
(the collection which was set to create thumbnails).


Does thumbnail generation work now? (If not, please reply and tell us in
what manner it goes wrong.)

Regards,
Anupama

Matt Bailey wrote:
> I've been setting up a greenstone instance for a professor here at DU
> on RHEL 5.5 32bit, greenstone 2.83
>
> GLI fails as such:
> http://i.imgur.com/rwV0y.png
>
>
> The same exact command runs fine from the command line: (greenstone's
> apache is running as the same user)
> $ full-import.pl -collectdir "/home/xiaohu/Greenstone/collect" -gli
> -language "en" xiao-photo
> <Import>
> Removing current contents of the archives directory...
> <File n=''>
> Global file scan checking directory:
> /home/xiaohu/Greenstone/collect/xiao-photo/import
> <File n='Boston City Flow.jpg'>
> <File n='metadata.xml'>
> <File n=''>
> <File n='Boston City Flow.jpg'>
> <File n='metadata.xml'>
>
> <Processing n='metadata.xml' p='MetadataXMLPlugin'>
> MetadataXMLPlugin: processing metadata.xml
> <File n='Boston City Flow.jpg'>
> <Processing n='Boston City Flow.jpg' p='ImagePlugin'>
> ImagePlugin processing Boston City Flow.jpg
> Converting image Boston City Flow.jpg to: THUMB gif ...
> ...done
> Converting image Boston City Flow.jpg to: SCREEN jpeg ...
> ...done
>
> *********************************************
> Import complete
> *********************************************
> <ImportComplete considered='1' processed='1' blocked='0' ignored='0' failed='0'>
> * 1 document was considered for processing
> * 1 was processed and included in the collection
>
>
>
> I think apache is not finding the imagemagick perl modules, but I'm
> not sure the right way for greenstone's apache to set up its
> environment (shouldn't it be doing this on its own anyway?)
> --
> Matt Bailey
> (720) 255-1141
> Senior Software Specialist
> University of Denver, UTS
> http://du.edu
> http://system42.net
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>