#49969 [Opn->Csd]: imagecolorat sample error
| From: | salathe@php.net | Date: | Fri, 23 Oct 2009 10:26:24 +0000 |
| Subject: | #49969 [Opn->Csd]: imagecolorat sample error | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2995@lists.php.net to get a copy of this message | ||
ID: 49969
Updated by: salathe@php.net
Reported By: admin at ifyouwantblood dot de
-Status: Open
+Status: Closed
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Thanks for the note about the missing parameter. Also note that
imagecolorsforindex returns an associative array (so the call to list
would not work). I have amended the example on both counts. Thanks for
the bug report.
Previous Comments:
------------------------------------------------------------------------
[2009-10-23 10:24:49] svn@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=289884
Log: Fixed broken example. Closes #49969
------------------------------------------------------------------------
[2009-10-23 10:11:22] admin at ifyouwantblood dot de
Description:
------------
In the sample code on imagecolorat() the function imagecolorsforindex()
is missing an argument, the image resource. See the man page for
imagecolorsforindex:
array imagecolorsforindex ( resource $image , int $index )
Reproduce code:
---------------
<?php
$im = imagecreatefrompng("php.png");
$rgb = imagecolorat($im, 10, 15);
list($r, $g, $b, $alpha) = imagecolorsforindex($rgb);
var_dump($r, $g, $b, $alpha);
Expected result:
----------------
<?php
$im = imagecreatefrompng("php.png");
$rgb = imagecolorat($im, 10, 15);
list($r, $g, $b, $alpha) = imagecolorsforindex($im, $rgb);
var_dump($r, $g, $b, $alpha);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49969&edit=1