xref: /PHP-7.2/ext/gd/tests/bug60160.phpt (revision 6972b94a)
1--TEST--
2Bug #60160 (imagefill does not work correctly for small images) @see bug51671
3--SKIPIF--
4<?php
5	if(!extension_loaded('gd')){ die('skip gd extension not available'); }
6?>
7--FILE--
8<?php
9$w = 3;
10$h = 50;
11$im = imagecreatetruecolor($w, $h);
12$white = imagecolorallocate($im, 255, 255, 255);
13imagefill($im, 0, 0, $white);
14
15for ($ix = 0; $ix < $w; $ix++) {
16        for ($iy = 0; $iy < $h; $iy++) {
17                if (($c = imagecolorat($im, $ix, $iy)) != $white) {
18                        printf("Failed, ($ix, $iy) is %X\n", $c);
19                }
20        }
21}
22
23echo "OK\n";
24?>
25--EXPECTF--
26OK
27