#51077 [Opn->Csd]: Example is wrong
| From: | degeberg@php.net | Date: | Thu, 18 Feb 2010 09:58:17 +0000 |
| Subject: | #51077 [Opn->Csd]: Example is wrong | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3932@lists.php.net to get a copy of this message | ||
ID: 51077
Updated by: degeberg@php.net
Reported By: awysocki at absoftware dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: CentOS 5.4
PHP Version: 5.2.12
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:
------------------------------------------------------------------------
[2010-02-18 09:57:49] svn@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&revision=295231
Log: Corrected example on Imagick::annotateImage() (fixes bug #51077)
------------------------------------------------------------------------
[2010-02-18 01:05:30] awysocki at absoftware dot com
Description:
------------
Example of Imagick::annotateImage is incorrect
Instead of
/* Black text */
$pixel->setColor('black');
It should be
/* Bluse text */
$draw->setFillColor('blue');
The function selects BLACK as the default and the setColor is working
on the image not the text
Reproduce code:
---------------
---
From manual page: http://www.php.net/function.imagick-annotateimage#See
Also
---
<?php
/* Create some objects */
$image = new Imagick();
$draw = new ImagickDraw();
$pixel = new ImagickPixel( 'gray' );
/* New image */
$image->newImage(800, 75, $pixel);
/* Font properties */
$draw->setFont('Bookman-DemiItalic');
$draw->setFontSize( 30 );
$draw->setFillColor('black' );
/* Create text */
$image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over
the lazy dog');
/* Give image a format */
$image->setImageFormat('png');
/* Output the image with headers */
header('Content-type: image/png');
echo $image;
?>
Expected result:
----------------
See Above
Actual result:
--------------
See Above
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=51077&edit=1