mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
Fixed bug #47946 (ImageConvolution overwrites background)
# original patch by jcolby at acsol dot net
This commit is contained in:
parent
90a2d19794
commit
c593790b62
@ -3870,7 +3870,7 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
|
||||
int x, y, i, j, new_a;
|
||||
float new_r, new_g, new_b;
|
||||
int new_pxl, pxl=0;
|
||||
gdImagePtr srcback;
|
||||
gdImagePtr srcback, srctrans;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
@ -3880,6 +3880,10 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
|
||||
|
||||
/* We need the orinal image with each safe neoghb. pixel */
|
||||
srcback = gdImageCreateTrueColor (src->sx, src->sy);
|
||||
srcback->saveAlphaFlag = 1;
|
||||
srctrans = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
|
||||
gdImageFill(srcback, 0, 0, srctrans);
|
||||
|
||||
gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy);
|
||||
|
||||
if (srcback==NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user