#39169 [Opn->Csd]: imagecolorallocate example uses incorrect snytax for imagecreate

From: Date: Mon, 16 Oct 2006 19:27:06 +0000
Subject: #39169 [Opn->Csd]: imagecolorallocate example uses incorrect snytax for imagecreate
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374231@lists.php.net to get a copy of this message
ID: 39169 Updated by: colder@php.net Reported By: neothermic at neothermic dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: N/A 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. Previous Comments: ------------------------------------------------------------------------ [2006-10-16 19:13:53] neothermic at neothermic dot com Description: ------------ In a related bug to #36447, imagecolorallocate has this example: <?php $im = imagecreate('example.jpg', 100, 100); // sets background to red $background = imagecolorallocate($im, 255, 0, 0); // sets some colors $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); // hexadecimal way $white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); $black = imagecolorallocate($im, 0x00, 0x00, 0x00); ?> However, imagecreate has this syntax: resource imagecreate ( int x_size, int y_size ) Ergo the first call in the example will issue an error. Suggested fix is as simple as ever: $im = imagecreate(100, 100); NeoThermic ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39169&edit=1

« previous php.doc (#969374231) next »