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.
This commit is contained in:
Sander Steffann 1999-11-24 21:43:54 +00:00
parent 9ed5ad0c58
commit 0f7444c4a8
3 changed files with 11 additions and 3 deletions

View 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

View 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

View 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 */