Bug #64641 [Opn->Ana]: imagefilledpolygon doesn't draw horizontal line
| From: | cmb@php.net | Date: | Mon, 20 Jul 2015 22:08:07 +0000 |
| Subject: | Bug #64641 [Opn->Ana]: imagefilledpolygon doesn't draw horizontal line | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194579@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64641&edit=1
ID: 64641
Updated by: cmb@php.net
Reported by: temposeb at free dot fr
Summary: imagefilledpolygon doesn't draw horizontal line
-Status: Open
+Status: Analyzed
Type: Bug
Package: GD related
-Operating System: Win XP Pro SP3
+Operating System: *
-PHP Version: 5.3.24
+PHP Version: 5.6.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I can confirm this issue. The solution would be simple: just
handle the special case of 1D polygons by delegating to
gdImagePolygon(); there's nothing to fill anyway.
The attached patch "git-am" does this, but it also breaks several
PHPTs. This demands further investigation on whether this is
caused by major behavioral changes (it doesn't appear so), and
maybe some discussion.
Previous Comments:
------------------------------------------------------------------------
[2015-07-20 22:06:46] cmb@php.net
The following patch has been added/updated:
Patch Name: git-am
Revision: 1437430006
URL: https://bugs.php.net/patch-display.php?bug=64641&patch=git-am&revision=1437430006
------------------------------------------------------------------------
[2013-04-12 19:08:46] temposeb at free dot fr
Description:
------------
At worst imagefilledpolygon( ) doesn't render at all object composed exclusively
of horizontal lines. No problem with vertical/diagonal lines or imagepolygon( ).
Test script:
---------------
$image = imagecreatetruecolor(640, 480) ;
// Vertical line, drawn
$points = array(100, 100, 100, 200, 100, 300) ;
imagefilledpolygon($image, $points, 3, 0xFFFF00) ;
// Horizontal line, not drawn
$points = array(300, 200, 400, 200, 500, 200) ;
imagefilledpolygon($image, $points, 3, 0xFFFF00) ;
header('Content-Type: image/png') ;
imagepng($image) ;
Expected result:
----------------
Two objects rendered : 1 vertical line, 1 horizontal line.
Actual result:
--------------
One object rendered : 1 vertical line.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64641&edit=1