I have a simple script dynamically generating a PNG based on form input:
--------------------
#!/usr/bin/perl
# genImage.perl
use strict;
print <<LLI;
Content-type: image/png
LLI
genPNG(); #a subroutine that can produce PNGs using libpng
--------------------
this worked fine before I used mod_perl. I've tried using:
$q->header('image/png');
instead of the print "Content-Type" line, to no avail. Annoyingly enough, if
I generate a jpeg ($q->header('image/jpeg')), albeit with a different library
routine, it works fine...
Other possibly relevant details:
Apache/1.3.12 (Unix) mod_perl/1.23
and in httpd.conf:
<Files *.perl>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Files>
I've even tried with PerlSendHeader Off and adding "HTTP 1/1 200 OK" headers
with the same result -- jpegs work fine, PNG does not...
Clues? I suspect it's a problem with the PNG production and some intereaction
between mod_perl and the headers that stock Apache doesn't encounter, but will
be most interested if there might be another explanation or solution.
Thanks,
Adi