From a840f429e7cf0c47b20bc37f7a765783a82908f3 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 11 Dec 2002 23:30:23 +0000 Subject: [PATCH] MFH (make imagecreatefromxpm() unavailable when bundled GD is used) --- ext/gd/gd.c | 6 +++--- ext/gd/php_gd.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 2cf4ad7ef1..e6b550a222 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -188,7 +188,7 @@ function_entry gd_functions[] = { #ifdef HAVE_GD_XBM PHP_FE(imagecreatefromxbm, NULL) #endif -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) PHP_FE(imagecreatefromxpm, NULL) #endif PHP_FE(imagecreatefromgd, NULL) @@ -1358,7 +1358,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, case PHP_GDIMG_TYPE_GD2PART: im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); break; -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) case PHP_GDIMG_TYPE_XPM: im = gdImageCreateFromXpm(fn); break; @@ -1425,7 +1425,7 @@ PHP_FUNCTION(imagecreatefromxbm) /* }}} */ #endif /* HAVE_GD_XBM */ -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) /* {{{ proto int imagecreatefromxpm(string filename) Create a new image from XPM file or URL */ PHP_FUNCTION(imagecreatefromxpm) diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 149f9092ba..e457551157 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -110,12 +110,14 @@ PHP_FUNCTION(imagecreatefromstring); PHP_FUNCTION(imagecreatefromgif); PHP_FUNCTION(imagecreatefromjpeg); PHP_FUNCTION(imagecreatefromxbm); -PHP_FUNCTION(imagecreatefromxpm); PHP_FUNCTION(imagecreatefrompng); PHP_FUNCTION(imagecreatefromwbmp); PHP_FUNCTION(imagecreatefromgd); PHP_FUNCTION(imagecreatefromgd2); PHP_FUNCTION(imagecreatefromgd2part); +#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) +PHP_FUNCTION(imagecreatefromxpm); +#endif PHP_FUNCTION(imagegammacorrect); PHP_FUNCTION(imagedestroy); -- 2.50.1