Bug #79763 [Opn->Nab]: imagefilledarc fails with odd arc sizes
| From: | cmb@php.net | Date: | Wed, 01 Jul 2020 10:48:30 +0000 |
| Subject: | Bug #79763 [Opn->Nab]: imagefilledarc fails with odd arc sizes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227754@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79763&edit=1
ID: 79763
Updated by: cmb@php.net
Reported by: greg at subaqua dot co dot uk
Summary: imagefilledarc fails with odd arc sizes
-Status: Open
+Status: Not a bug
Type: Bug
Package: GD related
Operating System: Ubuntu 18.04
PHP Version: 7.2.31
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
With regard to PHP this is a duplicate of bug #73614.
With regard to libgd this is a duplicate of
<https://github.com/libgd/libgd/issues/351>
which is fixed as of
libgd 2.3.0.
Previous Comments:
------------------------------------------------------------------------
[2020-07-01 10:23:40] greg at subaqua dot co dot uk
Description:
------------
When the arc size is specified as an ODD number of pixels, the arc angles are calculated
incorrectly.
When specified as an EVEN number of pixels, it works OK.
See https://imgur.com/a/QCdscXj
The problem seems to be a combination of PHP version and GD version.
Fails: Ubuntu 18.04
PHP:7.2.24-0ubuntu0.18.04.6
GD: 2.2.5
Works: Redhat 7
PHP: 7.1.33
GD: 2.3
Test script:
---------------
<?php
$image_size = 400;
$arc_size = $_GET['r'] ?? 275;
$image = imagecreate($image_size, $image_size);
$c1 = imagecolorallocate($image, 255, 255, 255);
$c2 = imagecolorallocate($image, 0, 255, 0);
$c3 = imagecolorallocate($image, 0, 0, 255);
imagefilledrectangle($image, 0, 0, $image_size, $image_size, $c1);
imagefilledarc($image, $image_size/2, $image_size/2, $arc_size, $arc_size, 135, 270, $c3,
IMG_ARC_PIE);
imagefilledarc($image, $image_size/2, $image_size/2, $arc_size, $arc_size, 270, 405, $c2,
IMG_ARC_PIE);
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79763&edit=1