1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Files
archived-php-src/ext/gd/tests/pngcomp.phpt
T
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

31 lines
683 B
PHP

--TEST--
png compression test
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
die("skip png support unavailable");
}
?>
--FILE--
<?php
$cwd = __DIR__;
echo "PNG compression test: ";
$im = imagecreatetruecolor(20,20);
imagefilledrectangle($im, 5,5, 10,10, 0xffffff);
imagepng($im, $cwd . '/test_pngcomp.png', 9);
$im2 = imagecreatefrompng($cwd . '/test_pngcomp.png');
$col = imagecolorat($im2, 8,8);
if ($col == 0xffffff) {
echo "ok\n";
}
@unlink($cwd . "/test_pngcomp.png");
?>
--EXPECT--
PNG compression test: ok