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