php-src/ext/gd/tests/imagegetclip_basic.phpt
Christoph M. Becker d795a6bf97 Implement #52857: Access to gdImageSetClip() and gdImageGetClip()
We add the necessary PHP bindings for both functions which are available
as of GD_2_0_12 (released 2006-04-05). The API of imagegetclip() is modelled
according to imageftbbox().
2016-07-23 16:14:36 +02:00

38 lines
553 B
PHP

--TEST--
imagegetclip() - basic functionality
--SKIP--
<?php
if (!extension_loaded('gd')) die('skip ext/gd required');
?>
--FILE--
<?php
$im = imagecreate(10, 10);
echo '=== original ===', PHP_EOL;
var_dump(imagegetclip($im));
imagesetclip($im, 1,2, 3,4);
echo '=== after imagesetclip() ===', PHP_EOL;
var_dump(imagegetclip($im));
?>
--EXPECT--
=== original ===
array(4) {
[0]=>
int(0)
[1]=>
int(0)
[2]=>
int(9)
[3]=>
int(9)
}
=== after imagesetclip() ===
array(4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
}