I've got a web page that includes a graph. I achieve this with code
that looks like:

     print "Content-type: text/html\n\n";
                          etc
                          etc
      my($myImage) = $myChart->plot(\...@data) or die $myChart->error;

      open(IMAGE, ">Images/zzzgraph.png") or die $!;
      binmode IMAGE;
      print IMAGE $myImage->png;
      close IMAGE;

      print "    <img src='Images/zzzgraph.png' width='800'
height='600'>\n";

Is it possible to eliminate the need to first write the image to
disk?

All my attempts at trying this have all failed. The best I get is with
the following code:

     print "Content-type: text/html\n\n";
                          etc
                          etc
      my($myImage) = $myChart->plot(\...@data) or die $myChart->error;
      print $myImage->png;

which produces gibberish where the chart should be. (cribbed from
http://linuxgazette.net/issue83/padala.html )

I suspect is that this specifies "Content-type: image/png\n\n" whereas
my web page specifies "Content-type: text/html\n\n".

I've tried specifying both content-types on my web page but this
results on the user being asked if they want to save the script
(??????).

Can it be done and how????

Thanks,

Bryan



-- 
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/


Reply via email to