This commit is contained in:
Rasmus Lerdorf 2008-07-31 09:23:59 +00:00
parent bc8defa547
commit f5dc937a0d
2 changed files with 7 additions and 1 deletions

View File

@ -2613,6 +2613,7 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
green /= spixels;
blue /= spixels;
alpha /= spixels;
alpha += 0.5;
}
if ( alpha_sum != 0.0f) {
if( contrib_sum != 0.0f) {

View File

@ -689,7 +689,12 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level, int basefilte
*/
a = gdTrueColorGetAlpha(thisPixel);
/* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */
*pOutputRow++ = 255 - ((a << 1) + (a >> 6));
if (a == 127) {
*pOutputRow++ = 0;
} else {
*pOutputRow++ = 255 - ((a << 1) + (a >> 6));
}
}
}
}