php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59514 Methods not working
Submitted: 2010-11-17 20:55 UTC Modified: 2010-11-18 10:53 UTC
From: pecl at multiwebinc dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.3.2 OS: Various
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pecl at multiwebinc dot com
New email:
PHP Version: OS:

 

 [2010-11-17 20:55 UTC] pecl at multiwebinc dot com
Description:
------------
Many of the ImagickDraw methods are not working, such as:

setStrokeOpacity
setFillOpacity
translate
skewX
skewY
rotate

and probably others. I think that most of the ImagickDraw methods should be reviewed as they do not produce an error, however they also do not produce any changes whatsoever to the image.

Reproduce code:
---------------
http://pastebin.com/jgJ3XNZf


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-17 21:15 UTC] mkoppanen@php.net
Hello,

as your example code did not really work I created a simple reproduce code here: http://valokuva.org/~mikko/bug19984/

This tests translate and setStrokeOpacity and they seem to be working fine.
 [2010-11-18 10:40 UTC] pecl at multiwebinc dot com
You're right. The problem was the ORDER I was doing things. Perhaps this should be better documented since it could definitely be confusing for those not overly familiar with Imagick/ImageMagick.

For example, setStrokeOpacity() does nothing here:

$im = new Imagick();
$im->newImage(200, 200, "gray", "png" );

$draw = new ImagickDraw();
$draw->line(10, 10, 50, 50);
$im->drawImage($draw);

$draw->translate(80, 30);
$draw->setStrokeWidth(10);
$draw->setStrokeColor('black');
$draw->line(10, 10, 50, 50);
$draw->setStrokeOpacity(0.5);
$im->drawImage($draw);

header("Content-Type: image/png");
echo $im;

All I did was switch the order of the setStrokeOpacity() to be after the line()
 [2010-11-18 10:53 UTC] mkoppanen@php.net
Sure, that is the behavior. Without this behavior it wouldn't be possible to draw things with different settings within the same object. 

The documentation really needs a large overhaul but there are only so many hours in a day.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 05:01:31 2024 UTC