in reply to Re^3: Generating image (map)
in thread Generating image (map)

Error reports that there is no png function in GD::Image... I looked it up and there really isn't any... But http://search.cpan.org/~lds/GD-2.44/GD.pm says that there should be... Actually they have example same as your code (which I just copied)

P.S. i forgot to ask... what does rgb2n function do? and will it work without it?
P.P.S. still not working, but i did it manualy with printing in .ppm file

Replies are listed 'Best First'.
Re^3: Generating image (map)
by BrowserUk (Patriarch) on Mar 20, 2010 at 06:48 UTC
    Error reports that there is no png function in GD::Image...

    It probably means that when your copy of libgd was built, the required library for png support was not available.

    P.S. i forgot to ask... what does rgb2n function do? and will it work without it?

    Most of the color related methods in GD are for use with palettised images, where you allocate a palette entry with the RGB value for that color, and get a palette index returned. You then supply that index to the drawing commands.

    For truecolor (24-bit color) images, you supply the RGB value, as an integer, directly to the drawing commands.

    rgb2n() does the job of converting an RGB triple into an integer in the right format for truecolor images.

    There might even be some built-in function for doing the same job, but if there is, it isn't obvious from the docs.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.