xref: /PHP-7.3/ext/gd/tests/libgd00191.phpt (revision c422d15d)
1--TEST--
2libgd FS#191 (A circle becomes square)
3--SKIPIF--
4<?php
5	if (!extension_loaded('gd')) die("skip gd extension not available\n");
6	if (!GD_BUNDLED) die("skip requires bundled GD library\n");
7?>
8--FILE--
9<?php
10$im = imagecreatetruecolor(100, 100);
11imagefilledrectangle($im, 0, 0, 100, 100, imagecolorallocate($im, 255, 255, 255));
12imagesetthickness($im, 20);
13imagefilledellipse($im, 30, 50, 20, 20, imagecolorallocate($im, 0, 0, 0));
14$index = imagecolorat($im, 12, 28);
15$arr = imagecolorsforindex($im, $index);
16if ($arr['red'] == 255 && $arr['green'] == 255 && $arr['blue'] == 255) {
17	echo "Ok";
18} else {
19	echo "failed";
20}
21?>
22--EXPECT--
23Ok
24