cvs: /php3 config.h.in configure.in /php3/functions gd.c
| From: | Sander Steffann | Date: | Wed, 24 Nov 1999 21:44:46 +0000 |
| Subject: | cvs: /php3 config.h.in configure.in /php3/functions gd.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13091@lists.php.net to get a copy of this message | ||
steffann Wed Nov 24 16:44:46 1999 EDT
Modified files:
/php3 config.h.in configure.in
/php3/functions gd.c
Log:
Some patched versions of GD support both GIF and PNG. The GD functions now
checks for both instead of assuming that PNG support means that there is no
GIF support anymore.
Index: php3/config.h.in
diff -u php3/config.h.in:1.201 php3/config.h.in:1.202
--- php3/config.h.in:1.201 Mon Nov 22 02:54:04 1999
+++ php3/config.h.in Wed Nov 24 16:44:14 1999
@@ -157,6 +157,7 @@
#define HAVE_LIBGD 0
#undef HAVE_GD_PNG
+#undef HAVE_GD_GIF
/* Define if you have the GNU gettext library (-lintl). */
#define HAVE_LIBINTL 0
Index: php3/configure.in
diff -u php3/configure.in:1.479 php3/configure.in:1.480
--- php3/configure.in:1.479 Mon Nov 22 03:30:14 1999
+++ php3/configure.in Wed Nov 24 16:44:14 1999
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.479 1999/11/22 08:30:14 sas Exp $
+dnl $Id: configure.in,v 1.480 1999/11/24 21:44:14 steffann Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
@@ -770,6 +770,7 @@
old_LIBS=$LIBS
LIBS="$LIBS -lpng -lz"
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG)])
+ AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF)])
AC_CHECK_LIB(gd, gdImageColorResolve, [ AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE) ])
LIBS=$old_LIBS
if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
@@ -824,6 +825,7 @@
old_LIBS=$LIBS
LIBS="$LIBS -lpng -lz"
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG)])
+ AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF)])
AC_CHECK_LIB(gd, gdImageColorResolve, [ AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE) ])
LIBS=$old_LIBS
if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
@@ -849,6 +851,7 @@
old_LIBS=$LIBS
LIBS="$LIBS -lpng -lz"
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG)])
+ AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF)])
AC_CHECK_LIB(gd, gdImageColorResolve, [ AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE) ])
LIBS=$old_LIBS
if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.135 php3/functions/gd.c:1.136
--- php3/functions/gd.c:1.135 Sat Nov 20 21:52:16 1999
+++ php3/functions/gd.c Wed Nov 24 16:44:14 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.135 1999/11/21 02:52:16 rasmus Exp $ */
+/* $Id: gd.c,v 1.136 1999/11/24 21:44:14 steffann Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -128,10 +128,11 @@
{"imagecopy", php3_imagecopy, NULL},
{"imagecopyresized", php3_imagecopyresized, NULL},
{"imagecreate", php3_imagecreate, NULL},
-#if !HAVE_GD_PNG
+#if HAVE_GD_GIF
{"imagecreatefromgif", php3_imagecreatefromgif, NULL},
{"imagegif", php3_imagegif, NULL},
-#else
+#endif
+#if HAVE_GD_PNG
{"imagecreatefrompng", php3_imagecreatefrompng, NULL},
{"imagepng", php3_imagepng,
NULL},
#endif
@@ -255,6 +256,9 @@
#if HAVE_GD_PNG
php3_printf(" with PNG support");
#endif
+#if HAVE_GD_GIF
+ php3_printf(" with GIF support");
+#endif
}
int php3_mend_gd(void){
@@ -447,7 +451,7 @@
}
/* }}} */
-#if !HAVE_GD_PNG
+#if HAVE_GD_GIF
/* {{{ proto int imagecreatefromgif(string filename)
Create a new image from file or URL */
void php3_imagecreatefromgif (INTERNAL_FUNCTION_PARAMETERS) {
@@ -489,7 +493,9 @@
RETURN_LONG(ind);
}
/* }}} */
-#else
+#endif /* HAVE_GD_GIF */
+
+#if HAVE_GD_PNG
/* {{{ proto int imagecreatefrompng(string filename)
Create a new image from file or URL */
void php3_imagecreatefrompng (INTERNAL_FUNCTION_PARAMETERS) {
@@ -531,7 +537,7 @@
RETURN_LONG(ind);
}
/* }}} */
-#endif
+#endif /* HAVE_GD_PNG */
/* {{{ proto int imagedestroy(int im)
Destroy an image */
@@ -841,7 +847,7 @@
}
/* }}} */
-#if !HAVE_GD_PNG
+#if HAVE_GD_GIF
/* {{{ proto int imagegif(int im [, string filename])
Output image to browser or file */
void php3_imagegif (INTERNAL_FUNCTION_PARAMETERS) {
@@ -918,7 +924,9 @@
RETURN_TRUE;
}
/* }}} */
-#else
+#endif /* HAVE_GD_GIF */
+
+#if HAVE_GD_PNG
/* {{{ proto int imagepng(int im [, string filename])
Output image to browser or file */
void php3_imagepng (INTERNAL_FUNCTION_PARAMETERS) {
@@ -995,7 +1003,7 @@
RETURN_TRUE;
}
/* }}} */
-#endif
+#endif /* HAVE_GD_PNG */
/* {{{ proto int imagesetpixel(int im, int x, int y, int col)
Set a single pixel */