ID: 41820 Updated by: [EMAIL PROTECTED] Reported By: richard dot gavenda at rksting dot cz -Status: Assigned +Status: Feedback Bug Type: GD related Operating System: Windows XP PHP Version: 5.2.3 Assigned To: pajoye New Comment:
CopyResampled using floating points to calculate the destination color. It may result to rounding problem. However I cannot reproduce this problem on my development platforms (x86 32 and 64bit, amd 64). What's your architecture? Previous Comments: ------------------------------------------------------------------------ [2007-06-27 10:08:39] richard dot gavenda at rksting dot cz Title correction ------------------------------------------------------------------------ [2007-06-27 10:07:40] richard dot gavenda at rksting dot cz Description: ------------ When resizing an image filled with solid color using imagecopyresampled, a destination image is not filled with same solid color, but with noise of two colors. I was tried this with grayscale images. Second color in noise was exactly same as source color, but with RGB channels lowered by 1. When the source image was filled with color, which had RGB channels values equal to power of 2 (0,1,2,4,8,16,32,64,128) the noise disappears. Reproduce code: --------------- $im = imagecreatetruecolor(1045,600); $back = imagecolorallocate($im, 100, 100, 100); imagefill($im, 0, 0, $back); $im2 = imagecreatetruecolor(383,220); imagecopyresampled($im2,$im,0,0,0,0,383,220,1045,600); imagepng($im2); Expected result: ---------------- PNG file filled with color 100,100,100(RGB) Actual result: -------------- PNG file filled with color noise of 100,100,100(RGB) and 99,99,99(RGB) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41820&edit=1