#40764 [Fbk->Csd]: imageline() problem
| From: | pajoye@php.net | Date: | Sat, 10 Mar 2007 01:24:16 +0000 |
| Subject: | #40764 [Fbk->Csd]: imageline() problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110173@lists.php.net to get a copy of this message | ||
ID: 40764
Updated by: pajoye@php.net
Reported By: php at lydiaade dot com
-Status: Feedback
+Status: Closed
Bug Type: GD related
Operating System: Redhat Enterprise 3
PHP Version: 5.2.1
Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-03-09 01:20:10] pajoye@php.net
You are right, my optimization did not care about line thickness. I
committed a fix in PHP_5_2 (5.2 branch), please try it.
I will merge in the other branches and add the test case tomorrow.
------------------------------------------------------------------------
[2007-03-09 00:54:38] php at lydiaade dot com
Description:
------------
imageline() now draws all horizontal and vertical lines as one pixel
thick, whichever line thickness has been set using imagesetthickness().
As it worked fine before I upgraded to 5.2.1, this is probably caused by
the recent optimisation of imageline().
Reproduce code:
---------------
<?php
$image=imagecreatetruecolor(400, 400);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $white);
imagesetthickness($image, 10);
imageline($image, 200, 0, 200, 400, $black);
imageline($image, 0, 200, 400, 200, $black);
imageline($image, 0, 0, 392, 392, $black);
header("Content-type: image/gif");
imagegif($image);
imagedestroy($image);
?>
Expected result:
----------------
This should draw three lines, all 10 pixels thick.
Actual result:
--------------
Only the diagonal line is the correct thickness.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40764&edit=1