[fwd]Re: Returning image/gif Content-type
Stanley Gambarin (gambarin@OpenMarket.com)
Fri, 07 Feb 1997 17:09:58 -0500
Message-Id: <199702072209.RAA00665@u4-138.openmarket.com>
To: fastcgi-developers@OpenMarket.com
Subject: [fwd]Re: Returning image/gif Content-type
Date: Fri, 07 Feb 1997 17:09:58 -0500
From: Stanley Gambarin <gambarin@OpenMarket.com>
------- Forwarded Message
From: "Brian Millett" <bpm@terraweb.com>
To: Nigel Metheringham <Nigel.Metheringham@theplanet.net>
CC: fastcgi-developers@OpenMarket.com
Subject: Re: Returning image/gif Content-type
In-Reply-To: <m0vsRir-00078DC@dingo.theplanet.co.uk>
References: <32F9A4A8.1C3@dmcsoft.com>
<m0vsRir-00078DC@dingo.theplanet.co.uk>
Reply-To: bpm@techapp.com
Errors-To: bpm@techapp.com
X-Actually-From: "" <bpm@vlad.terraweb.com>
Date: Thu, 6 Feb 1997 09:32:03 -0600
Message-Id: <19970206153203.AAA28332@vlad.terraweb.com>
Nigel Metheringham writes:
|
|} I was trying to write a little fcgi app last night which returned a gif
|} created on the fly using the gd library. I figured that I'd just need to
|} put out a content type header of image/gif, then write the gif to
|} stdout. However, this doesn't seem to have worked - the error logs on
|} the web server suggest a malformed content type header. Has anyone else
|} tried something like this and got it working? I checked the list
|} archive, and someone asked the same question a while back but got no
|} answer.
|
|getting gd to write stdout is a bit of a problem - basically it needs to
|fork and do things that way (seemed odd to me too!). I expect the data
|packaging for the multiplexed FCGI output stream is getting all mixed up
|because of this.
|
|Try getting gd to write the gif to a temp file (which it does without
|forking), then open and read that temp file, writing the data down the
|output, finally unlinking the temp file.
|
This was also the problem using GD.pm from Lincoln Stein
<http://www.genome.wi.mit.edu/ftp/pub/software/WWW/GD.html>
But he rewrote the perl module so that it works just fine with fcgi.
I don't have any problems with it in my fcgi perl applications.
- --
Brian Millett
Technology Applications Inc. "Heaven can not exist,
(314) 530-1981 If the family is not eternal"
bpm@techapp.com F. Ballard Washburn
------- End of Forwarded Message