Bug #64641 [Sus->ReO]: imagefilledpolygon doesn't draw horizontal line

From: Date: Mon, 20 Jun 2016 12:46:44 +0000
Subject: Bug #64641 [Sus->ReO]: imagefilledpolygon doesn't draw horizontal line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201748@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: Suspended +Status: Re-Opened Type: Bug Package: GD related Operating System: * PHP Version: 5.6.11 Assigned To: cmb Block user comment: N Private report: N New Comment: The libgd PR has been merged, so I'm re-opening. Previous Comments: ------------------------------------------------------------------------ [2016-06-19 15:10:31] cmb@php.net Update: I've submitted an improved PR against libgd (https://github.com/libgd/libgd/pull/236). Until this is resolved, I suspend this ticket. ------------------------------------------------------------------------ [2015-07-20 22:08:07] cmb@php.net 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#201748) next »