xref: /PHP-7.2/ext/gd/tests/bug73614.phpt (revision 61cfa34e)
1--TEST--
2Bug #73614 (gdImageFilledArc() doesn't properly draw pies)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix not yet released');
7?>
8--FILE--
9<?php
10require_once __DIR__ . '/func.inc';
11
12$image = imagecreatetruecolor(500, 500);
13
14$white    = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
15$navy     = imagecolorallocate($image, 0x00, 0x00, 0x80);
16$red      = imagecolorallocate($image, 0xFF, 0x00, 0x00);
17
18imagefilledarc($image, 250, 250, 500, 250, 0, 88, $white, IMG_ARC_PIE);
19imagefilledarc($image, 250, 250, 500, 250, 88, 91 , $navy, IMG_ARC_PIE);
20imagefilledarc($image, 250, 250, 500, 250, 91, 360 , $red, IMG_ARC_PIE);
21
22test_image_equals_file(__DIR__ . '/bug73614.png', $image);
23?>
24===DONE===
25--EXPECT--
26The images are equal.
27===DONE===
28