1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00

MFB: Fixed bug #47946 (ImageConvolution overwrites background)

This commit is contained in:
Ilia Alshanetsky
2009-04-12 14:45:05 +00:00
parent d10fb3127c
commit 0bb885a441
+5 -1
View File
@@ -3863,7 +3863,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;
@@ -3873,6 +3873,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) {