XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The foregoing comments are mostly true, but not entirely. There is the data: URI, but not all browsers support it. It allows image data to be embedded directly in the HTML, and there is even a Perl module that makes it easy to use in a CGI environment. The following code will generate some text and an image consisting of a red square with a blue-outline square inside of it:
This is a CGI script, even though I didn't actually use CGI, as it didn't help to illustrate the point. Anyway, the code produces this output: Netscape 4.7 on Linux showed the image without any problems. Opera did not. So results may vary. Also, there is apparently some restriction on the maximum size of such an embedded image, but so far I've not been able to determine what that is. Maybe someone else will know. One would think that something could be done with the multipart/mixed MIME type. This is how mixed content is included in email messages, but so far my efforts to make this work with a browser have come up dry. I'm with you, though. It seems idiotic to require a separate request for data that could just as easily be included with the main document. Update: Since images don't seem to be permitted in the SOPW nodes, I've included a sample similar to the above on my home node: Dr. Mu In reply to Re: Incorporating On-The-Fly Graphics In CGI output
by Dr. Mu
|
|