php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40764 imageline() problem
Submitted: 2007-03-09 00:54 UTC Modified: 2007-03-10 01:24 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at lydiaade dot com Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.2.1 OS: Redhat Enterprise 3
Private report: No CVE-ID: None
 [2007-03-09 00:54 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-09 01:20 UTC] 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-10 01:24 UTC] pajoye@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC