diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-04-29 17:23:16 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-04-29 17:23:16 +0200 |
commit | 18a9ae412f00cc1e312c296952fac24f16b4d4de (patch) | |
tree | 681b78e1ab9354f68e7a0d9109ec1ad287522dc6 | |
parent | 3891e0d13a0e85e51a450a868960e98b5c74df56 (diff) | |
download | php-git-18a9ae412f00cc1e312c296952fac24f16b4d4de.tar.gz |
Fix #77943: imageantialias($image, false); does not work
Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.
We also make sure that we don't attempt to enable anti-aliasing for
palette images.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/gd/gd.c | 6 |
2 files changed, 8 insertions, 1 deletions
@@ -5,6 +5,9 @@ PHP NEWS - FPM: . Fixed bug #77921 (static.php.net doesn't work anymore). (Peter Kokot) +- GD: + . Fixed bug #77943 (imageantialias($image, false); does not work). (cmb) + - JSON: . Fixed bug #77843 (Use after free with json serializer). (Nikita) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 50d4745371..231fcac381 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -4699,7 +4699,11 @@ PHP_FUNCTION(imageantialias) if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) { RETURN_FALSE; } - gdImageSetAntiAliased(im, 0); + + if (im->trueColor) { + im->AA = alias; + } + RETURN_TRUE; } /* }}} */ |