|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-14 09:59 UTC] tony2001@php.net
[2007-03-14 11:00 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 08:00:01 2025 UTC |
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)