1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 13:31:27 +02:00
Files
archived-php-src/ext/gd/tests/imagecolourstotal_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

42 lines
986 B
PHP

--TEST--
Test imagecolorstotal() function : basic functionality
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists("imagecolorstotal")) {
die("skip imagecolorstotal() not available.");
}
?>
--FILE--
<?php
echo "*** Testing imagecolorstotal() : basic functionality ***\n";
// Palette image
$img = imagecreate( 50, 50 );
var_dump( imagecolorstotal( $img ) );
$bg = imagecolorallocate( $img, 255, 255, 255 );
var_dump( imagecolorstotal( $img ));
$bg = imagecolorallocate( $img, 255, 0, 0 );
$bg = imagecolorallocate( $img, 0, 0, 255 );
var_dump( imagecolorstotal( $img ));
imagedestroy( $img );
// Truecolor image
$img = imagecreatetruecolor( 50, 50 );
var_dump( imagecolorstotal( $img ) );
$bg = imagecolorallocate( $img, 255, 255, 255 );
var_dump( imagecolorstotal( $img ) );
imagedestroy( $img );
?>
--EXPECT--
*** Testing imagecolorstotal() : basic functionality ***
int(0)
int(1)
int(3)
int(0)
int(0)