Skip to content

Commit 2ede8db

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78923: Artifacts when convoluting image with transparency
2 parents 1d69bf1 + aba070e commit 2ede8db

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

ext/gd/libgd/gd_filter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
362362
for ( y=0; y<src->sy; y++) {
363363
for(x=0; x<src->sx; x++) {
364364
new_r = new_g = new_b = 0;
365+
pxl = f(srcback, x, y);
365366
new_a = gdImageAlpha(srcback, pxl);
366367

367368
for (j=0; j<3; j++) {

ext/gd/tests/bug47946.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
--TEST--
22
Bug #47946 (ImageConvolution overwrites background)
3-
--DESCRIPTION--
4-
The expected image has black pixel artifacts, what is another issue, though
5-
(perhaps #40158).
63
--SKIPIF--
74
<?php
85
if (!extension_loaded('gd')) die('skip gd extension not available');
6+
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
97
?>
108
--FILE--
119
<?php

ext/gd/tests/bug47946_exp.png

-41 Bytes
Loading

0 commit comments

Comments
 (0)