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

Re: Print to screen

From: Tony Cook (
Date: Sun 13 Jul 2003 - 23:52:55 GMT

  • Next message: 10233@xyz.molar.is: "GIF support"

    On Fri, Jul 11, 2003 at 12:06:40PM -0700, Tom Cresap wrote:
    > Tony,
    > Imager seems to be working nicely on many of the sample programs that I
    > have found. The sample program simplelogo1.pl was trying to write() out
    > a gif file, and after using the
    > perl -MImager -le 'print for keys %Imager::formats'
    > command you sent I see that I don't have support for gif files. Can I
    > add gif support?

    You need to install giflib and it's development files to use GIF files.

    When you run Makefile.PL you will get a question:

      You have libgif or libungif installed. They are both known to have
      bugs. Imager can crash or display other strange behaviour after
      reading or writing gif images. Some of the gif tests can even fail
      since they stress some parts of the buggy code.

      Do you want to remove gif support? [Y/n]

    Answer 'n' to have GIF supported.

    > Also I am trying to get Imager to print a png file to the screen using
    > the code below, after creating $img and writing it to a file.

    When you say to the screen, I assume you mean to a web brower via CGI.

    > Imager graphics code creates and writes() $img
    > binmode STDOUT;
    > print $img->png;

    Imager has no png() method, though I think GD does.

    > The write() is working, but Imager says that it can't find "png.al in
    > @INC" for the print function, is it available somewhere? Thanks. Tom

    No, you're calling a method that doesn't exist.

    There's an example in:

      perldoc Imager::Files

    that shows how to write an image to a web browser, search for "Producing an image from a CGI script".