pajoye Sat Nov 4 03:15:31 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/gd/tests bug39366.phpt
Modified files: /php-src NEWS /php-src/ext/gd/libgd gd.c Log: - MFH #39366, imagerotate does not use alpha with angles>45 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.328&r2=1.2027.2.547.2.329&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.328 php-src/NEWS:1.2027.2.547.2.329 --- php-src/NEWS:1.2027.2.547.2.328 Sat Nov 4 02:24:53 2006 +++ php-src/NEWS Sat Nov 4 03:15:31 2006 @@ -11,7 +11,8 @@ . Make sure PHP_SELF is filtered in Apache 1 sapi. . Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to php_filter.h). -- Fixed bug #39273 (imagecopyresized may ignore alpha channel) +- Fixed bug #39366 (imagerotate does not use alpha with angle > 45°) (Pierre) +- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre) - Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()). (Ilia) - Fixed bug #39354 (Allow building of curl extension against libcurl 7.16.0) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.3&r2=1.90.2.1.2.4&diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.3 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.4 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.3 Sat Nov 4 02:21:06 2006 +++ php-src/ext/gd/libgd/gd.c Sat Nov 4 03:15:31 2006 @@ -2750,6 +2750,9 @@ dst->transparent = src->transparent; if (dst != NULL) { + int old_blendmode = dst->alphaBlendingFlag; + dst->alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uY<src->sy; uY++) { @@ -2769,6 +2772,7 @@ } } } + dst->alphaBlendingFlag = old_blendmode; } return dst; @@ -2792,6 +2796,9 @@ dst->transparent = src->transparent; if (dst != NULL) { + int old_blendmode = dst->alphaBlendingFlag; + dst->alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uY<src->sy; uY++) { @@ -2812,6 +2819,7 @@ } } } + dst->alphaBlendingFlag = old_blendmode; } return dst; @@ -2835,6 +2843,9 @@ dst->transparent = src->transparent; if (dst != NULL) { + int old_blendmode = dst->alphaBlendingFlag; + dst->alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uY<src->sy; uY++) { @@ -2855,6 +2866,7 @@ } } } + dst->alphaBlendingFlag = old_blendmode; } return dst; http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug39366.phpt?view=markup&rev=1.1 Index: php-src/ext/gd/tests/bug39366.phpt +++ php-src/ext/gd/tests/bug39366.phpt --TEST-- Bug #39366 (imagerotate does not respect alpha with angles>45) --SKIPIF-- <?php if (!extension_loaded('gd')) die("skip gd extension not available\n"); if (!GD_BUNDLED) die('skip external GD libraries always fail'); ?> --FILE-- <?php $im = imagecreatetruecolor(10,10); imagealphablending($im, 0); imagefilledrectangle($im, 0,0, 8,8, 0x32FF0000); $rotate = imagerotate($im, 180, 0); imagecolortransparent($rotate,0); imagesavealpha($rotate, true); $c = imagecolorat($rotate,5,5); printf("%X\n", $c); ?> --EXPECTF-- 32FF0000 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php