|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-17 03:13 UTC] mkoppanen@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 08:00:02 2025 UTC |
Description: ------------ Setting properties of an ImagickDraw object, and then calling clone() on that object, does not return a true clone with the original object's properties. (Linux, PHP 5.2.5, ImageMagick 6.3.6-10, Imagick 2.0.1) On line 14871 of imagick.c (from SVN), we see the following: IMAGICKDRAW_REPLACE_DRAWINGWAND( internd, tmpWand ); Shouln't this be the following? IMAGICKDRAW_REPLACE_DRAWINGWAND( intern_return, tmpWand ); Reproduce code: --------------- $hDraw = new ImagickDraw(); $hDraw->setFontSize(100); $hDraw->setFillColor(new ImagickPixel("rgba(128,128,128,0.5)")); $hClone = $hDraw->clone(); echo "Original ImagickDraw:<pre>" . print_r($hDraw->getFillColor()->getColor(), true) . "</pre>"; echo $hDraw->getFontSize() . "<br>"; echo "Cloned ImagickDraw:<pre>" . print_r($hClone->getFillColor()->getColor(), true) . "</pre>"; echo $hClone->getFontSize() . "<br>"; Expected result: ---------------- Original and Cloned ImagickDraw objects should have the same properties. Actual result: -------------- Cloned result has a fill-color of black and a font-size of 12 (the default values for a new ImagickDraw object).