in reply to Random Pictures Using .pngs ... how?

I have a new question about this.

Is there a way that I can use this newly created .png picture in a Perl generated HTML file, as a regular image?

If so, this would prove very useful for a variety of programming exercises I wish to perform eventually using this technique.

Andy Summers
  • Comment on Is there a way that I can use this new image in a web page?

Replies are listed 'Best First'.
Re: Is there a way that I can use this new image in a web page?
by BrotherAde (Pilgrim) on Aug 21, 2001 at 11:06 UTC

    There certainly is... all you need to do is put a link to the "image" into your html, e.g. <img src="random.pl" height="100" width="100" />.

    What I did on one of my servers is actually to tell Apache that all the *.png-files in a certain directory are to be handled as perl-scripts, so the user on the other end thinks s/he's getting real *.png images.

    Both methods in this post require your script to print "content-type: image/png\n\n"; before the actual image.

    Hope that helps
    BrotherAde