|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59026 distortImage compounds distortion when used more than once
Submitted: 2010-01-10 07:37 UTC Modified: 2010-02-28 07:42 UTC
From: lee dot traynor at skeptic dot de Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.3.0 OS: Windows XP SP3
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:
Bug Type:
From: lee dot traynor at skeptic dot de
New email:
PHP Version: OS:


 [2010-01-10 07:37 UTC] lee dot traynor at skeptic dot de
When used iteratively, imagick:distortImage compounds the distortion on the image from one image to the next.

Reproduce code:
# $grfile is a panoramic image; $incr is the displacement in
$grfile = "Canadas.png";
$incr = 10;
# For some strange reason, "new" requires the tiemzone to be set
date_default_timezone_set ("Europe/Berlin");
$imsrc = new Imagick ($grfile);
$srcwidth = $imsrc->getImageWidth ();
$srcheight = $imsrc->getImageHeight ();
$image_type = $imsrc->getImageFormat ();
$subdir = substr ($grfile, 0, strpos ($grfile, "."));
if (!is_dir ($subdir)) mkdir ($subdir);
$aspectratio = 4/3;
$destwidth = floor ($srcheight * $aspectratio);
$imax = ceil ($srcwidth  - $destwidth) / $incr;
$dx = $dy = -0.02;
$distort = array (0.0, 0.0, $dx, 1 - $dx * $aspectratio, 0.0, 0.0, $dy, 1
- $dy);
for ($i = 0; $i < $imax; $i++)
	set_time_limit (10);
	$file_dest = $subdir . "\\" . sprintf ("%04u", $i) . "." . $image_type;
	$start = round ($i * $incr);
	$imdest = $imsrc->clone ();
	$imdest->cropImage ($destwidth, $srcheight, $start, 0);
	$imdest->distortImage (imagick::DISTORTION_BARREL, $distort, true);
	$imdest->writeImage ($file_dest);
	$imdest->destroy ();
$imsrc->destroy ();

Expected result:
A series of images with identical barrel distortions.

Actual result:
A series of images with the distortion increasing from one image to the next.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-27 15:13 UTC]

I am unable to reproduce this issue on linux. What version of Imagick are you running?
 [2010-02-28 07:42 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 09:01:29 2024 UTC