diff options
author | Christoph M. Becker <cmb@php.net> | 2016-07-14 17:20:19 +0200 |
---|---|---|
committer | Christoph M. Becker <cmb@php.net> | 2016-07-14 17:25:13 +0200 |
commit | 5829458215597058c54189b951e0c923deaeaf9b (patch) | |
tree | b2a3365cd22d214fa51f1aeb257e547e2df22251 | |
parent | 131117f7a57781307518c2d451ea840aa657aac8 (diff) | |
parent | 8bb3bd04a9d38c08dce0034ad8fc1263631d28ff (diff) | |
download | php-git-5829458215597058c54189b951e0c923deaeaf9b.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | UPGRADING | 2 | ||||
-rw-r--r-- | ext/gd/gd.c | 4 | ||||
-rw-r--r-- | ext/gd/tests/bug72596.phpt | 12 |
4 files changed, 21 insertions, 0 deletions
@@ -28,6 +28,9 @@ PHP NEWS . Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user). (gooh) +- GD: + . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb) + - Intl: . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain names). (cmb) @@ -740,6 +740,8 @@ out, that the corresponding SDK isn't available anymore. . ZLIB_FINISH - GD + . IMG_WEBP (>= 7.0.10) + . T1Lib support removed, thus lifting the optional dependency on T1Lib, the following is therefore not available anymore: diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b09990938d..a3b33fdef3 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1047,6 +1047,7 @@ PHP_MINIT_FUNCTION(gd) REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMG_WEBP", 32, CONST_CS | CONST_PERSISTENT); /* special colours for gd */ REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT); @@ -2124,6 +2125,9 @@ PHP_FUNCTION(imagetypes) #if defined(HAVE_GD_XPM) ret |= 16; #endif +#ifdef HAVE_GD_WEBP + ret |= 32; +#endif if (zend_parse_parameters_none() == FAILURE) { return; diff --git a/ext/gd/tests/bug72596.phpt b/ext/gd/tests/bug72596.phpt new file mode 100644 index 0000000000..2eb7dadb76 --- /dev/null +++ b/ext/gd/tests/bug72596.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #72596 (imagetypes function won't advertise WEBP support) +--SKIPIF-- +<?php +if (!extension_loaded('gd')) die('skip gd extension not available'); +?> +--FILE-- +<?php +var_dump(function_exists('imagewebp') === (bool) (imagetypes() & IMG_WEBP)); +?> +--EXPECT-- +bool(true) |