PDA

View Full Version : Problem enabling CGI support



domesticbeer
08-02-2002, 10:15 AM
Every time i compile with the --enable-cgi-dir=/home/httpd/cgi-bin and the --enable-cgi-icons=/home/httpd/htdocs/eq-icons set in the configure command. I get an error with i do a make with in the drawmap.cpp file on some undeclared function. I will recompile tonite and post the error message for you all to see.

here is the error that i am seeing

drawmap.cpp: In function 'void paintMap()';
drawmap.cpp:529: 'gdImageGif' undeclared (first use thie function)
drawmap.cpp:529: (Each undeclared identifier is reported only once for each function it appears in.)
make[2]: *** [drawmap.o] Error 1
make[2]: Leaving directory '/showeq/src'
make[1]: *** [all-recursive] Error 1


Any thoughts?

Linux load
I am running gentoo 1.2 complied with gcc3 and qt3.04. I also have qt 2.32 installed it happens if i use qt3.04 or 2.32.

fryfrog
08-02-2002, 11:02 AM
i'm trying right now, using /home/httpd/cgi-bin/ and /home/httpd/htdocs/eq-icons. we'll see what happens. do you have imagemagick installed?

also, does the compile make the eq-icons that go into the dir? or do we get them from somewhere? i've never played with the cgi portion of seq.

fryfrog
08-02-2002, 11:10 AM
drawmap.cpp: In function `void paintMap()':
drawmap.cpp:529: `gdImageGif' undeclared (first use this function)
drawmap.cpp:529: (Each undeclared identifier is reported only once for each func
tion it appears in.)
g++-3.1 -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/qt/2-gcc-3.1/include -I/usr/X11R6/in
clude -DMAPDIR=\"/usr/local/share/showeq\" -DLOGDIR=\"/usr/local/share/showeq\"
-I/usr/include/pcap -D_REENTRANT -O2 -Wall -g -ggdb -DDEBUG -finline-functi
ons -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=true -DICON_DIR=\"/home/httpd/htdocs
/eq-icons/\" -c listspawn.cpp

same thing you get, time to find out what this "gdImageGif" is :)

fryfrog
08-02-2002, 11:14 AM
emerge GD


**edit: damnit, that wasn't it.

Cryonic
08-02-2002, 11:36 AM
Found that gdImageGif is no longer in GD.

http://www.ee.ethz.ch/~slist/mrtg/msg06780.html

Guess they removed it because of the patent and royalties that a company is pursuing.

http://mapserver.gis.umn.edu/wilma/mapserver-users/0003/msg00010.html

Mr. Suspicious
08-02-2002, 12:10 PM
Ah, so true, slipped my mind when I read this thread, Boutell (http://www.boutell.com/gd/) did indeed remove .gif support from the GD library some time ago due to patent related issues. Their website specifies it also on the top of the GD page:



GD Graphics Library

An ANSI C library for the dynamic creation of images. GD creates PNG and JPEG images, among other formats. GD does not create GIF images.


and



Questions? READ THE MANUAL THOROUGHLY FIRST. Then, if your question is about building our distribution of gd, or about using gd with C, consider sending email to [email protected]. DON'T ASK FOR GIF-BASED VERSIONS OF GD. HARANGUES ABOUT GIF WILL BE DELETED UNREAD. Thank you!


Note the funny alcaps =)

And the manual input on it (http://www.boutell.com/gd/manual1.8.4.html):



HEY! READ THIS! gd 1.8.4 creates PNG, JPEG and WBMP images, not GIF images. This is a good thing. PNG is a more compact format, and full compression is available. JPEG works well with photographic images, and is still more compatible with the major Web browsers than even PNG is. WBMP is intended for wireless devices (not regular web browsers). Existing code will need modification to call gdImagePng or gdImageJpeg instead of gdImageGif. Please do not ask us to send you the old GIF version of GD. Unisys holds a patent on the LZW compression algorithm, which is used in fully compressed GIF images. The best solution is to move to legally unencumbered, well-compressed, modern image formats such as PNG and JPEG as soon as possible.

domesticbeer
08-02-2002, 12:38 PM
guess time to edit that file are remove that reference.

domesticbeer
08-02-2002, 02:08 PM
Ok here are the lines of code that are cause the problem


/* Print the http header */
#ifdef HAVE_GD_IMAGEPNG
printf ("Content-type: image/png\n\n");
#else
printf ("Content-type: image/gif\n\n");
#endif

/* Output image */
#ifdef HAVE_GD_IMAGEPNG
gdImagePng(im, stdout);
#else
gdImageGif(im, stdout);
#endif

/* Destroy image */
gdImageDestroy(im);


If I take out the the lines that have a reference to gifs to make it look this way



/* Print the http header */
#ifdef HAVE_GD_IMAGEPNG
printf ("Content-type: image/png\n\n");
#endif

/* Output image */
#ifdef HAVE_GD_IMAGEPNG
gdImagePng(im, stdout);
#endif

/* Destroy image */
gdImageDestroy(im);



It should work and only will now only display the image as a PNG. corrrect?

Cryonic
08-02-2002, 02:21 PM
Sounds right, just make sure that ./configure sees your png libraries (libpng???).

domesticbeer
08-02-2002, 02:23 PM
Yea, first check was to make sure that I downloaded and installed GD last night to see if that fixed the Complie problem. So if this works I will diff the drawmap.cpp and submit it for inclusion in the next release.

Mr. Suspicious
08-02-2002, 08:16 PM
Thanks, domesticbeer

domesticbeer
08-03-2002, 07:38 AM
Patch has been submitted. Question though SEQ doesnt support JPEG compression does it? If so that may get removed soon depending how that patent battle turns out.

domesticbeer
08-03-2002, 07:46 AM
Ok this is messed up got the CGI support stuff complied but when i do the listitem.cgi all the images are broken. Same with drawmap.cgi . Am I missing something? i go to /home/httpd/cgi-bin all the cgis are there. i then go to /home/httpd/htdocs/eq-icons nothing in that directory. I am baffled.

fryfrog
08-03-2002, 07:55 AM
i had that problem to. i have no idea where the "eq-icons" are actually supposed to come from. anyone? :)