php-src/ext/gd/tests/imagesetclip_basic.phpt
Christoph M. Becker a375d54785
Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

25 lines
573 B
PHP

--TEST--
imagesetclip() - basic functionality
--EXTENSIONS--
gd
--FILE--
<?php
// draw a clipped diagonal line
$im = imagecreate(100, 100);
imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
imagesetclip($im, 10,10, 89,89);
imageline($im, 0,0, 99,99, $white);
// save image for manual inspection
// imagepng($im, __FILE__ . '.png');
// verify that the clipping has been respected
imagesetclip($im, 0,0, 99,99);
var_dump(imagecolorat($im, 9,9) !== $white);
var_dump(imagecolorat($im, 90,90) !== $white);
?>
--EXPECT--
bool(true)
bool(true)