#40801 [NEW]: imagecolorat works incorrectly with imagecreatefromgif and imagecreatefrompng

From: Date: Wed, 14 Mar 2007 09:53:43 +0000
Subject: #40801 [NEW]: imagecolorat works incorrectly with imagecreatefromgif and imagecreatefrompng
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110327@lists.php.net to get a copy of this message
From: belkovich at yandex dot ru Operating system: Win XP Pro PHP version: 5.2.1 PHP Bug Type: GD related Bug description: imagecolorat works incorrectly with imagecreatefromgif and imagecreatefrompng Description: ------------ Hello imagecolorat works incorrectly with imagecreatefromgif and imagecreatefrompng and it works with imagecreatefromjpeg Here is working code: <?php $im = imagecreatefromjpeg("Capture.jpg"); $rgb = imagecolorat($im,10,10); echo $rgb; $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; echo $r."_".$g."_".$b; ?> Sincerely, Dmitry Reproduce code: --------------- <?php $im = imagecreatefromgif("Capture.gif"); $rgb = imagecolorat($im,10,10); echo $rgb; $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; echo $r."_".$g."_".$b; ?> Expected result: ---------------- 255_255_255 on white color, when use imagecolorat with jpg Actual result: -------------- 0_0_106 on white color, when use PNG imagecreatefrompng) or imagecreatefromgif(with GIF file) -- Edit bug report at http://bugs.php.net/?id=40801&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40801&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40801&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40801&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40801&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40801&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40801&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40801&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40801&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40801&r=support Expected behavior: http://bugs.php.net/fix.php?id=40801&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40801&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40801&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40801&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40801&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40801&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40801&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40801&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40801&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40801&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40801&r=mysqlcfg

« previous php.bugs (#110327) next »