Re: GS image generation fails

From Stefan Boddie
DateThu, 12 Dec 2002 09:54:17 +1300
Subject Re: GS image generation fails
In-Reply-To (20021208193243C-tao-lib-uchicago-edu)
Hi Tod,

The first thing I'd suggest is that you get an up-to-date copy of Greenstone
using CVS (details at http://www.greenstone.org/english/docs/cvs.html).
Unfortunately the gimp-perl scripts in gsdl-2.38 are a little out of date.

Once you've done that you should be able to create new greenstone interface
images either manually using the title_icon-1.2.pl, flash_button-1.2.pl,
etc. scripts or automatically using the translate.pl script.

Either way, it's probably a good idea to take a look at translate.pl. This
script parses a Greenstone macro file and processes any images specified in
it (most of the english language images are specified in the english.dm
macro file and generated using translate.pl). Images are specified with
comments as follows:

## "titles a-z" ## nav_bar_button ## ttitl ##

When translate.pl processes the above it'll create "nav_bar_button" type
images with the text "titles a-z" on them. If you search in translate.pl for
"nav_bar_button" you'll see it creates the images by executing the following
two commands (the first creates the yellow "titles a-z" button and it's
rollover image and the second creates the green "disabled" version of the
button).

flash_button-1.2.pl -text "titles a-z" -filenamestem ttitl -fontsize
17 -height 17 -fixed_width -width 87

green_bar-1.2.pl -text "titles a-z" -filename ttitlgr.gif

Once you get all this working the easiest way to create new images is
probably to create a dummy macro file that contains just the ## ... ## ...
## ... ## comments specifying the new images. You can then process them all
at once with translate.pl. Changing the colours, fonts, etc can be done with
simple changes to translate.pl.

I hope some of this helps.

regards,
Stefan.

----- Original Message -----
From: "Tod Olson" <tao@lib.uchicago.edu>
To: <greenstone@tripath.colosys.net>
Sent: Monday, December 09, 2002 2:32 PM
Subject: GS image generation fails


> I'm running Greenstone 2.38 on a RedHat Linux 7.2 box, gimp-1.2.1-7 and
> gimp-perl-1.2.1-7 rpms are installed.
>
> First attemp to generate images resulted in:
>
> title_icon.pl: required callback 'net' not found (ERROR)
> title_icon.pl: required callback 'net' not found (ERROR)
>
> I noticed the title_icon-1.2.pl, etc. scripts and copied them into place.
Now I get:
>
> title_icon.pl: /^HASH(0x82219ac/: unmatched () in regexp at
/usr/local/gsdl/bin/script/gimp/title_icon.pl line 385. (DIE)
> title_icon.pl: /^HASH(0x82219ac/: unmatched () in regexp at
/usr/local/gsdl/bin/script/gimp/title_icon.pl line 385. (DIE)
>
> This is in the wrap_text subroutine:
>
> sub wrap_text {
>
> # don't wrap text if it already contains carriage returns
> return if $text =~ / /;
>
> # the following assumes that all words are less than $wrap_length long
> my $wrap_length = 14;
>
> my $new_text = "";
> while (length ($text) >= $wrap_length) {
> my $line = substr ($text, 0, $wrap_length);
> $text =~ s/^$line//; # <--- line 385
> $line =~ s/s([^s]*)$/ /;
> $text = $1 . $text;
> $new_text .= $line;
> }
> $new_text .= $text;
> $text = $new_text;
> }
>
> Perl's not my gig, but it looks like $line comes from a config file
> somewhere.
>
> Anyone have a clue?
>
> The follow question will be: once these scripts are working, I will
> want to customize the images somewhat. For example, I have browseable
> MusicGenre metadata, but I want the nav bar button to say "genre."
> Might also want to change the default color scheme and such. I know
> these images live in $GSDLHOME/images, but I don't know the naming
> conventions, and I don't know whether some of the defaults live in a
> file somewhere. Any light shed would be appreciated.
>
>
> Tod A. Olson <tod@uchicago.edu> "How do you know I'm mad?" said Alice.
> Programmer / Analyst "If you weren't mad, you wouldn't have
> The University of Chicago Library come here," said the Cat.
>
>