summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-12-07 12:09:16 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-12-07 12:09:16 +0100
commit2ede8db1b455e0988167aa0dee2e014220471152 (patch)
tree8400181d06f37771ed36d377641231928db276c3 /ext/gd
parent1d69bf187fdd4e1ec78d8bb06c3dbce3ab6b5d53 (diff)
parentaba070e6308519be6b44e2ec6d153bb8b1e08371 (diff)
downloadphp-git-2ede8db1b455e0988167aa0dee2e014220471152.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78923: Artifacts when convoluting image with transparency
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/libgd/gd_filter.c1
-rw-r--r--ext/gd/tests/bug47946.phpt4
-rw-r--r--ext/gd/tests/bug47946_exp.pngbin396 -> 355 bytes
3 files changed, 2 insertions, 3 deletions
diff --git a/ext/gd/libgd/gd_filter.c b/ext/gd/libgd/gd_filter.c
index 566330668e..db364c923e 100644
--- a/ext/gd/libgd/gd_filter.c
+++ b/ext/gd/libgd/gd_filter.c
@@ -362,6 +362,7 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
for ( y=0; y<src->sy; y++) {
for(x=0; x<src->sx; x++) {
new_r = new_g = new_b = 0;
+ pxl = f(srcback, x, y);
new_a = gdImageAlpha(srcback, pxl);
for (j=0; j<3; j++) {
diff --git a/ext/gd/tests/bug47946.phpt b/ext/gd/tests/bug47946.phpt
index cb180f5b22..8c262eaabd 100644
--- a/ext/gd/tests/bug47946.phpt
+++ b/ext/gd/tests/bug47946.phpt
@@ -1,11 +1,9 @@
--TEST--
Bug #47946 (ImageConvolution overwrites background)
---DESCRIPTION--
-The expected image has black pixel artifacts, what is another issue, though
-(perhaps #40158).
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
+if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/bug47946_exp.png b/ext/gd/tests/bug47946_exp.png
index 7eb462dd88..4c69a9eea3 100644
--- a/ext/gd/tests/bug47946_exp.png
+++ b/ext/gd/tests/bug47946_exp.png
Binary files differ