Bug #79763 [NEW]: imagefilledarc fails with odd arc sizes
| From: | greg at subaqua dot co dot uk | Date: | Wed, 01 Jul 2020 10:23:40 +0000 |
| Subject: | Bug #79763 [NEW]: imagefilledarc fails with odd arc sizes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227753@lists.php.net to get a copy of this message | ||
From: greg at subaqua dot co dot uk
Operating system: Ubuntu 18.04
PHP version: 7.2.31
Package: GD related
Bug Type: Bug
Bug description:imagefilledarc fails with odd arc sizes
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 bug report at https://bugs.php.net/bug.php?id=79763&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79763&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79763&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79763&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79763&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79763&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79763&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79763&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79763&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79763&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79763&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79763&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79763&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79763&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79763&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79763&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79763&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79763&r=mysqlcfg