Re: [greenstone-devel] @michael: source code ofmake-classifier-images.cgi?

From Michael Dewsnip
DateFri, 22 Jul 2005 10:43:42 +1200
Subject Re: [greenstone-devel] @michael: source code ofmake-classifier-images.cgi?
In-Reply-To (42DEC9B1-9010204-gmx-net)
Hi Jens,

>would it be possible to get the source code of your image generator
>i'd like to provide such a functionality for a script of my own: if
>a user specifies a "-buttonname" in the collect.cfg file the
>appropriate images would be created on the fly. so your script would
>help me a lot.
Yes, of course. However this is not something that we distribute with
Greenstone, so I haven't made much effort to make it work on multiple
platforms etc. Also, it is not something we want to support (although
we're always interested in bug fixes).

You can download a zip file containing the files from

The zip file contains two .cgi files (which should go in your Greenstone
"cgi-bin" directory if you want to use them) and an "image-generation"
folder (which should be a sibling of your "gsdl" directory). This folder
contains the background images used for the buttons, and the core Perl
scripts for pasting the text onto these buttons.

The .cgi scripts include some Unix specific commands in backticks. You
would have to change these if you want to run it on Windows. The
image-generation Perl scripts should be more portable. I've had problems
in the past with the script on Windows however, and there is
some code near the end that you may have to uncomment if you're getting
blank images on Windows.

The image generation scripts require ImageMagick
( to be installed, along with the PerlMagick
extension. It also requires Freetype (
to be installed. Lastly, you need to copy some TTF font files into the
"image-generation" folder for the scripts to use. For Greenstone I use
the "ARIALBD.TTF" and "ARIALUNI.TTF" files, which I copied from a
Windows machine.

I hope this is enough to get you going.