From: Sander Steffann Date: Wed, 24 Nov 1999 21:43:54 +0000 (+0000) Subject: Some patched versions of GD support both GIF and PNG. The GD module now X-Git-Tag: PRE_RETURN_REF_PATCH~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f7444c4a845ae2fcf0b5d6a75f52f9ce9b13500;p=php Some patched versions of GD support both GIF and PNG. The GD module now checks for both instead of assuming that PNG support means that there is no GIF support anymore. --- diff --git a/ext/gd/config.h.stub b/ext/gd/config.h.stub index d13e8df475..1fce8aa1a0 100644 --- a/ext/gd/config.h.stub +++ b/ext/gd/config.h.stub @@ -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 diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index aa7208b043..ccb332cafc 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -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 diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b2b7a8bcf9..7d4bddd642 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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 */