GD not working

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I cannot make GD (graphics or GIF display) to produce any kind of
graphics from Perl. I cannot find the solution from the previous
postings in this newgroup or anywhere else on the net, but others seem
to have similar problems. So a rather lengthy description of the
problem. Apologies in advance !!!

I installed Perl from ActiveState (a couple of times). It
works very well in our Windows XP/administrator setup. Except when
printing graphs on data.

From the Perl Cookbook we got the idea of installing GD. The code
starts out

  use GD::Graph::lines; ...

Started out by downloading from the windows
DLL (.zip) file. This extracts, but does not add any immediate support
for GD... because Perl complains that INC cannot see GD. Also the
bgd.dll and a few exe files does not seem to belong anywhere - except
in the newly extracted folder. Tried to copy these files to windows
and perl binary folders, but off course no action. Still, all the talk
about linking seemed to be for C-programmers and/or UNIX users. There
must be a way ...

Also some talk about libpng and zlib. Same argument, the necessary
code is hopefully available somewhere to copy or install.

In the boutell doc was the message: gd can also be used from Perl,
courtesy of Lincoln Stein's library
( /). Downloaded that zip info.

Here was a piece of (perl) code, starting out with
  use GD;
  # create a new image
  $im = new GD::Image(100,100);
which would produce a graphic image of a red circle. Extracted the new
zip-file, which should be ppm'ed to install. This did not work as the
'GD.PPD could not be found'. But on this group was a mention of a
working ppd, namely

   ppm install

which had a correct PPD and completed. PPM has acknowledged a version
1.27.2 is installed. And now the above mentioned "use GD;" in the perl
script is passed wihtout any problems. Unfortunately the last lines of
the example is
   # And fill it with red
   # make sure we are writing to a binary stream
   binmode STDOUT;
   # Convert the image to PNG and print it on standard output
   print $im->png;

Nothing happens, except for some nonsense characters being displayed
and the bell sounds a few times. Anybody has any idea ?

Site Timeline