|Perl Monk, Perl Meditation|
Generating pngs with Masonby water (Deacon)
|on Dec 04, 2005 at 01:33 UTC||Need Help??|
water has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to generate dynamic pngs with Mason, like the photo gallery article on perl.com.
I'm trying to get the simple bits working before folding in the full application logic, so for now, I'm just trying to use a dhandler to server a red square for any file requests ending in .png in a certain directory. (That directory has no real png files.)
The dhandler looks like this:
and the directory in question is set to use Mason on .png files.
The dhandler is running, as I can reach the die message (by uncommenting that line).
But no image is displayed: firefox displays the file name requested (whatever.png); IE shows a broken image.
The related Mason book example on "generating something besides html" mentions $r->send_http_header, which I seems to be an Apache1.x-ism. I'm using Apache 2, which I suspect is relevant. The Apache2.x docs seem to imply that $r->send_http_header isn't necessary, that is, that just calling $r->content_type is sufficient.
In short, I'm not getting my red square.
I am not sure if my error is Mason or Apache or what.
Any ideas, wise monks?