On Jan 21, 2007, at 11:39 PM, Matus UHLAR - fantomas wrote:
On 21.01.07 14:35, Israel Brewster wrote:I have a perl script running in apache 1.3 which generates a .png image. If i run it normally (using system perl), it works. When I try running it under mod_perl however (increased performance, works under chrooting), the first line of the png file data (the image headers) gets cut off, making it so the system no longer recognizes it a an image, and all I get is a bunch of giberish on the screen. Is there something I can do to fix this? Thanks.what if you try to run it as CGI?
That works, if I understand what you are saying. Running it through the webserver just as a CGI (not using mod_perl) creates and displays the .png properly. it is only when running through mod_perl that there is an issue.
I think that the first line should give server the content type, optionallyfollowing a few header lines, and then the image...
I think you're right. Unfortunately, it's these first few lines that get chopped, leaving the server with no idea what type of file it is dealing with. As a result, it either just dumps the raw contents to the browser, or else downloads it as a binary. unfortunately, even then it can't display as it is missing some essential lines. As an example, if I run the command "less file.png" on a good .png image, the ASCII representation of the binary code for the first few lines is the following:
<89>PNG ^Z ^@^@^@^MIHDR^@^@^Co^....and so on and so forth. The files created by the script (when run through mod_perl), however, look like so:
^Z ^@^@^@^MIHDR^@^@^Co^@note that the <89>PNG portion is missing. It may be worth noting that the scrip has the option to create GIF's rather than PNG's, but the GIFS run into the same issue.
----------------------------------------------- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 ----------------------------------------------- --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx