]> granicus.if.org Git - php/commitdiff
Some patched versions of GD support both GIF and PNG. The GD module now
authorSander Steffann <steffann@php.net>
Wed, 24 Nov 1999 21:43:54 +0000 (21:43 +0000)
committerSander Steffann <steffann@php.net>
Wed, 24 Nov 1999 21:43:54 +0000 (21:43 +0000)
checks for both instead of assuming that PNG support means that there is no
GIF support anymore.

ext/gd/config.h.stub
ext/gd/config.m4
ext/gd/gd.c

index d13e8df475c8d3dd7b70b673ed184c5efa40e3a9..1fce8aa1a0df0bbcfdcecc25526777edf9f78ac3 100644 (file)
@@ -8,4 +8,7 @@
 #undef FREETYPE_4BIT_ANTIALIAS_HACK
 #undef HAVE_LIBFREETYPE
 #undef HAVE_LIBTTF
+
+/* Some versions of GD support both PNG and GIF. Set defines for both. */
 #undef HAVE_GD_PNG
+#undef HAVE_GD_GIF
index aa7208b0439616928d0fa31a8b3c2bb643eb8bd1..ccb332cafc4ed923e27c9e173387e04d69a3c54f 100644 (file)
@@ -25,7 +25,9 @@ AC_ARG_WITH(gd,
         AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
                LIBS="$LIBS -lpng -lz"
         AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1)])
+dnl Some versions of GD support both PNG and GIF. Check for both.
         AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1)])
+        AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF, 1)])
         
         LIBS=$old_LIBS
         LDFLAGS=$old_LDFLAGS
index b2b7a8bcf9c7a374a19871a1f7342dae9ebc6d55..7d4bddd642f430559e9027a62a41c990d312046e 100644 (file)
@@ -101,7 +101,8 @@ function_entry gd_functions[] = {
 #ifdef HAVE_GD_PNG
        PHP_FE(imagecreatefrompng,                                              NULL)
        PHP_FE(imagepng,                                                                NULL)
-#else
+#endif
+#ifdef HAVE_GD_GIF
        PHP_FE(imagecreatefromgif,                                              NULL)
        PHP_FE(imagegif,                                                                NULL)
 #endif
@@ -479,7 +480,9 @@ void php3_imagepng (INTERNAL_FUNCTION_PARAMETERS) {
 }
 /* }}} */
 
-#else
+#endif /* HAVE_GD_PNG */
+
+#ifdef HAVE_GD_GIF
 
 /* {{{ proto int imagecreatefromgif(string filename)
 Create a new image from file or URL */
@@ -604,7 +607,7 @@ PHP_FUNCTION(imagegif )
 }
 /* }}} */
 
-#endif /* HAVE_IMAGECREATEFROMPNG */
+#endif /* HAVE_GD_GIF */
 
 /* {{{ proto int imagedestroy(int im)
 Destroy an image */