com php-src: add external 2.1 detection and fix gd_compat f or 2.1+: ext/gd/config.m4 ext/gd/gd.c ext /gd/libgd/gd_compat.h
| From: | Pierre Joye | Date: | Wed, 10 Apr 2013 18:12:25 +0000 |
| Subject: | com php-src: add external 2.1 detection and fix gd_compat f or 2.1+: ext/gd/config.m4 ext/gd/gd.c ext /gd/libgd/gd_compat.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71912@lists.php.net to get a copy of this message | ||
Commit: 224a67fb9f91f027efa8142d6b81072b33bd6cc5
Author: Pierre Joye <pierre.php@gmail.com> Wed, 10 Apr 2013 20:12:25 +0200
Parents: ecdf8bcc455a660086f85b47f68ecc802c20ac2b
Branches: PHP-5.3 PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=224a67fb9f91f027efa8142d6b81072b33bd6cc5
Log:
add external 2.1 detection and fix gd_compat for 2.1+
Changed paths:
M ext/gd/config.m4
M ext/gd/gd.c
M ext/gd/libgd/gd_compat.h
Diff:
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index ebbdb92..d85c8b9 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -252,6 +252,8 @@ AC_DEFUN([PHP_GD_CHECK_VERSION],[
PHP_CHECK_LIBRARY(gd, gdFreeFontCache, [AC_DEFINE(HAVE_GD_FREEFONTCACHE, 1, [ ])], [],
[ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdFontCacheMutexSetup, [AC_DEFINE(HAVE_GD_FONTMUTEX, 1, [ ])], [],
[ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [],
[ -L$GD_LIB $GD_SHARED_LIBADD ])
+ PHP_CHECK_LIBRARY(gd, gdImageConvolution, [AC_DEFINE(HAVE_GD_IMAGE_CONVOLUTION, 1, [
])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
+ PHP_CHECK_LIBRARY(gd, gdImagePixelate, [AC_DEFINE(HAVE_GD_IMAGE_PIXELATE, 1, [
])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
])
dnl
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 3bb9fa2..25f5368 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1241,9 +1241,13 @@ PHP_RSHUTDOWN_FUNCTION(gd)
/* }}} */
#if HAVE_GD_BUNDLED
-#define PHP_GD_VERSION_STRING "bundled (2.0.34 compatible)"
+#define PHP_GD_VERSION_STRING "bundled (2.1.0 compatible)"
#else
-#define PHP_GD_VERSION_STRING "2.0"
+# ifdef GD_VERSION_STRING
+# define PHP_GD_VERSION_STRING GD_VERSION_STRING
+# else
+# define PHP_GD_VERSION_STRING "2.0"
+# endif
#endif
/* {{{ PHP_MINFO_FUNCTION
diff --git a/ext/gd/libgd/gd_compat.h b/ext/gd/libgd/gd_compat.h
index c084a00..779e709 100644
--- a/ext/gd/libgd/gd_compat..h
+++ b/ext/gd/libgd/gd_compat.h
@@ -32,6 +32,7 @@ int gdImageContrast(gdImagePtr src, double contrast);
/* Simply adds or substracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
+#if !defined(HAVE_GD_IMAGE_CONVOLUTION)
/* Image convolution by a 3x3 custom matrix */
int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset);
int gdImageEdgeDetectQuick(gdImagePtr src);
@@ -40,12 +41,18 @@ int gdImageSelectiveBlur( gdImagePtr src);
int gdImageEmboss(gdImagePtr im);
int gdImageMeanRemoval(gdImagePtr im);
int gdImageSmooth(gdImagePtr im, float weight);
+#endif
+
+#if !defined(HAVE_GD_IMAGE_PIXELATE)
enum gdPixelateMode {
GD_PIXELATE_UPPERLEFT,
GD_PIXELATE_AVERAGE
};
int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode);
+#endif
+
+int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode);
#if !HAVE_GD_IMAGEELLIPSE
void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c);