(none) imager-devel
/ help / lists / applications / search /

RE: printing generated png image

Date: Sat 10 May 2003 - 11:00:41 GMT

  • Next message: rayg: "Re: automatically finding format of 'data' type"

    I don't know if it's much benifit to the browser to know how large a file
    it is receiving.

    One disadvantage of the method below is that you copy the data out of the
    image object, and store it in another variable -- when you could have
    just written it to STDOUT.

    $| = 1; forces the output buffer of the current handle (in this case,
    STDOUT) to be flushed each time a print, printf, or write statement is


    On Fri, 9 May 2003, Dan Muey wrote:

    > I just cjecked out the perldoc page mentioned below and am wondering the pros and cons of
    > The two ways mentioned under "Producing an image from a CGI script"
    > my $data;
    > $img->write(type=>'gif', data=>\$data)
    > or die $img->errstr;
    > binmode STDOUT;
    > print header(-type=>'image/gif', -content_length=>length($data));
    > print $data;
    > If I do it that way do I still need to do
    > $| = 1;
    > Thanks
    > Dan