View previous topic :: View next topic |
Author |
Message |
neptune -
Joined: 04 Nov 2003 Posts: 2
|
Posted: Tue Nov 04, 2003 2:28 am Post subject: CGI GIF output corrupted |
|
|
I have a cgi written in C that dynamically creates a small GIF. It works without any problems under apache on a linux system and most of the time under Abyss on WinXP.
Under Abyss, the output is sometimes corrupted. It seems that Abyss is incorrectly adding 0x0D before every instance of a 0x0A byte for a mime-type of image/gif . Obviously this corrupts the GIF image.
FYI: The cgi is called in html code similar to the following example:
Code: | <img src="ptile.cgi?l=3.5&h=4.6"> |
The CGI parsed header output is as follows:
Code: | Content-type: image/gif
|
Am I missing something here? _________________ Neptune |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Nov 07, 2003 1:42 am Post subject: Re: CGI GIF output corrupted |
|
|
Abyss doesn't add any \r or \n. It is the C stdio function that does so on Windows and you should be careful when outputting binary data to stdout.
If you want some help with this issue, please send us your C code to support@aprelium.com and we'll show you how to fix the problem. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
neptune -
Joined: 04 Nov 2003 Posts: 2
|
Posted: Fri Nov 07, 2003 3:44 am Post subject: |
|
|
Much apreciated aprelium. I changed stdout to binary mode with the following:
Code: | #include <fcntl.h>
#include <io.h>
_setmode(_fileno(stdout), _O_BINARY); |
And all works as expected. _________________ Neptune |
|
Back to top |
|
|
|