From: richard dot gavenda at rksting dot cz Operating system: Windows XP PHP version: 5.2.3 PHP Bug Type: GD related Bug description: Color noise in resized image when using IMAGECOPYESAMPLED
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 bug report at http://bugs.php.net/?id=41820&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41820&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41820&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41820&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41820&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41820&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41820&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41820&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41820&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41820&r=support Expected behavior: http://bugs.php.net/fix.php?id=41820&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41820&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41820&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41820&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41820&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41820&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41820&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41820&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41820&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41820&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41820&r=mysqlcfg