Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 199684 - pecl-imagick-2.0.1 ImagickDraw::clone() does not return cloned object
Summary: pecl-imagick-2.0.1 ImagickDraw::clone() does not return cloned object
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-19 18:06 UTC by Daniel J.
Modified: 2007-11-19 18:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix ImagickDraw::clone() bug (imagick-2.0.1-draw-clone.patch,420 bytes, patch)
2007-11-19 18:07 UTC, Daniel J.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel J. 2007-11-19 18:06:19 UTC
Calling clone() on an ImagickDraw object does not return a clone of the object, but rather returns a new ImagickDraw object with all properties set to defaults.

This bug has already been reported upstream, and has been fixed in CVS.  See http://pecl.php.net/bugs/bug.php?id=12463

Reproducible: Always

Steps to Reproduce:
$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>";
Actual Results:  
Cloned result has a fill-color of black and a font-size of 12 (the
default values for a new ImagickDraw object).

Expected Results:  
Original and Cloned ImagickDraw objects should have the same properties.
Comment 1 Daniel J. 2007-11-19 18:07:59 UTC
Created attachment 136425 [details, diff]
Patch to fix ImagickDraw::clone() bug

This patch is against pecl-imagick 2.0.1.  It has already been applied in upstream CVS and will be included in pecl-imagick 2.1.0RC2.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-11-19 18:14:49 UTC
Poke us when 2.1.0 final is out and we'll commit that, thanks.