Re: FCGI & GD.pm problems

Lincoln Stein (lstein@genome.wi.mit.edu)
Mon, 12 Aug 1996 17:15:02 -0400

Date: Mon, 12 Aug 1996 17:15:02 -0400
Message-Id: <199608122115.RAA06038@chico.wi.mit.edu>
From: Lincoln Stein <lstein@genome.wi.mit.edu>
To: "Rujith S. de Silva" <desilva@ind70.industry.net>
Subject: Re: FCGI & GD.pm problems
In-Reply-To: <320B6C90.446B9B3D@ind70.industry.net>
 <320B6C90.446B9B3D@ind70.industry.net>

I've always been annoyed that I had to write that awful open(GGD,"-|")
hack in order to capture GD's gif files.  I should probably modify gd
myself in order to gain access to the internal data structures.

Lincoln

Rujith S. de Silva writes:
 > I claimed in an earlier message that I had successfully integrated
 > gd1.2, GD.pm 1.00 and fcgi.  In fact, I had successfully compiled the
 > stuff so that the same perl binary could be used to generate gifs, or to
 > execute FCGI code.  However, trying to generate gifs from within FCGI
 > code doesn't work.  I'm looking at the problem - so far, this is what I
 > think:
 > 
 > gd writes the gifs it generates to STDOUT.  GD.pm uses open(GGD,"-|");
 > to fork a child process that generates the gif using gd and writes it to
 > STDOUT, and the parent process reads it in and converts it to a string.
 > gd attempts to flush characters as they're generated.  Somewhere during
 > this process, the following error is generated:
 > 
 > 	fflush returned nonzero result code.
 > 
 > I hope this is helpful.  I'm still trying to track down the problem.
 > Sorry for my mistaken claim of success in my prior email.
 > 
 > A suggestion: could gd be re-written or extended to return the result in
 > a (char *) buffer, rather than writing it to FILE * stdout?  This would
 > make GD.pm much simpler and a lot more efficient.  Until them, GD.pm is
 > going to fork a process for each gif it generates - this is VERY
 > inefficient, and makes it hardly worthwhile to integrate GD.pm with
 > FCGI.
 > 
 > Later,
 > Rujith.