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