perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Display GD graphics with embperl
Date Sun, 21 Jul 2002 13:16:10 GMT
Hi,

> $rec_req->content_type('image/png');
> binmode STDOUT;
> print STDOUT $req->{image}->plot(\@data)->png();
>

As others already pointed out, you need to print to OUT instead of STDOUT,
otherwise the content will be send before the http headers and the browser
will not see the content-type header. Additionaly you have to set $escmode
to zero. There is no need for the binmode. Make sure you have no addtionaly
spaces in the file, othwise they will also send to the browser.

[-
$escmode = 0 ;
$rec_req->content_type('image/png');
print OUT $req->{image}->plot(\@data)->png();
-]

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message