At 5:53 PM +0100 3/26/02, Axel Beckert - ecos gmbh wrote: >But in general it works. E.g. the following little Embperl script >works fine: > >[- $req_rec->content_type('image/gif'); # Sending the right header > $escmode = 0; # No HTML escaping > $image = 'embperl_pb2.gif'; > open(IMG,'<',$image) or die "Can't open $image: $!"; > read(IMG,$buffer,-s IMG); > close(IMG); > print OUT $buffer; -]
I usually call Apache::Exit at the end of that sequence, just to make sure nothing else from the file gets output, although I'm not sure it's necessary, and of course you don't want to have anything before the [- for the same reason. >I guess the reason is, as Michael stated, that templating systems >aren't the best idea for generating images. I have had my 404 page generate images when people went to non-existent images on my site. But it turned out to be easier to just do a redirect. However Embperl2 recipes could make for some interesting possibilities. I can imagine XML files taking arguments from the browser and then automatically generating images. -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ [EMAIL PROTECTED] I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]