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

It seems I'm a bit of a moron... For some reason I can't install GD on my system...
First I tried using cpan shell... It reported some errors and then stopped...
Then I tried to install GD from source going over readme instructions for GD... Somehow I failed that too...
Then I tried to find a library readme file said usually causes problems... I didn't found it...
I know I'm doing something terribly wrong, but I don't know what... :(
Can you tell me what am I doing wrong?

Replies are listed 'Best First'.
Re^3: Generating image (map)
by BrowserUk (Patriarch) on Mar 20, 2010 at 00:08 UTC
    Can you tell me what am I doing wrong?

    On the basis of that description, no.


    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.
      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
        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.
      Yes, I figured... Forgot to put error messages...
      Meanwhile, I figured it out... I think I did (about to test it)... Stupid mistakes... So stupid...
      Thanks anyway, I'll try not to bother you anymore... :)

      P.S. It works, but reports error:
      "Can't locate object method "png" via package "GD::Image" at ./uilab.pl line 21" :-/
      P.P.S Code is c/p of your first reply