Skip to content

Commit b682f42

Browse files
committed
- [DOC] always enable imagefilter and imageconvolution, even when built against system's gd
1 parent 8b63e5b commit b682f42

File tree

8 files changed

+532
-470
lines changed

8 files changed

+532
-470
lines changed

ext/gd/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ if test "$PHP_GD" = "yes"; then
269269
libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \
270270
libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \
271271
libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \
272-
libgd/xbm.c libgd/gd_gif_out.c libgd/gd_security.c libgd/gd_pixelate.c"
272+
libgd/xbm.c libgd/gd_gif_out.c libgd/gd_security.c libgd/gd_filter.c libgd/gd_pixelate.c"
273273

274274
dnl check for fabsf and floorf which are available since C99
275275
AC_CHECK_FUNCS(fabsf floorf)
@@ -342,7 +342,7 @@ else
342342

343343
if test "$PHP_GD" != "no"; then
344344
GD_MODULE_TYPE=external
345-
extra_sources="gdcache.c libgd/gd_compat.c"
345+
extra_sources="gdcache.c libgd/gd_compat.c libgd/gd_filter.c libgd/gd_pixelate.c"
346346

347347
dnl Various checks for GD features
348348
PHP_GD_ZLIB

ext/gd/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (PHP_GD != "no") {
3333
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
3434
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
3535
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
36-
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c gd_security.c gd_pixelate.c", "gd");
36+
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c gd_security.c gd_filter.c gd_pixelate.c", "gd");
3737
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
3838
ADD_FLAG("CFLAGS_GD", " \
3939
/D HAVE_GD_DYNAMIC_CTX_EX=1 \

ext/gd/gd.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
132132
* IMAGE_FILTER_MAX_ARGS: define the biggest amout of arguments
133133
* image_filter array in PHP_FUNCTION(imagefilter)
134134
* */
135-
#if HAVE_GD_BUNDLED
136135
#define IMAGE_FILTER_NEGATE 0
137136
#define IMAGE_FILTER_GRAYSCALE 1
138137
#define IMAGE_FILTER_BRIGHTNESS 2
@@ -159,7 +158,7 @@ static void php_image_filter_selective_blur(INTERNAL_FUNCTION_PARAMETERS);
159158
static void php_image_filter_mean_removal(INTERNAL_FUNCTION_PARAMETERS);
160159
static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS);
161160
static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
162-
#endif
161+
163162
/* End Section filters declarations */
164163
static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
165164
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
@@ -855,7 +854,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_png2wbmp, 0)
855854
ZEND_END_ARG_INFO()
856855
#endif
857856

858-
#ifdef HAVE_GD_BUNDLED
859857
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefilter, 0, 0, 2)
860858
ZEND_ARG_INFO(0, im)
861859
ZEND_ARG_INFO(0, filtertype)
@@ -871,7 +869,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_imageconvolution, 0)
871869
ZEND_ARG_INFO(0, div)
872870
ZEND_ARG_INFO(0, offset)
873871
ZEND_END_ARG_INFO()
874-
#endif
875872

876873
#ifdef HAVE_GD_BUNDLED
877874
ZEND_BEGIN_ARG_INFO(arginfo_imageantialias, 0)
@@ -1046,10 +1043,8 @@ const zend_function_entry gd_functions[] = {
10461043
PHP_FE(imagexbm, arginfo_imagexbm)
10471044
#endif
10481045
/* gd filters */
1049-
#ifdef HAVE_GD_BUNDLED
10501046
PHP_FE(imagefilter, arginfo_imagefilter)
10511047
PHP_FE(imageconvolution, arginfo_imageconvolution)
1052-
#endif
10531048

10541049
{NULL, NULL, NULL}
10551050
};
@@ -4738,8 +4733,6 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
47384733
#endif /* HAVE_LIBGD */
47394734

47404735
/* Section Filters */
4741-
#ifdef HAVE_GD_BUNDLED
4742-
47434736
#define PHP_GD_SINGLE_RES \
47444737
zval *SIM; \
47454738
gdImagePtr im_src; \
@@ -5033,9 +5026,9 @@ PHP_FUNCTION(imageconvolution)
50335026
}
50345027
}
50355028
/* }}} */
5036-
50375029
/* End section: Filters */
50385030

5031+
#ifdef HAVE_GD_BUNDLED
50395032
/* {{{ proto bool imageantialias(resource im, bool on)
50405033
Should antialiased functions used or not*/
50415034
PHP_FUNCTION(imageantialias)

0 commit comments

Comments
 (0)