mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
a3159d29bb
PNG allows identical images to be stored differently what makes nearly all tests checking the MD5 hash of the PNG representation fail with external libgd. For now, we use the GD format instead, which doesn't allow for such differences. Of course, this md5() checking should be replaced by a image diffing feature in the long run.
28 lines
583 B
PHP
28 lines
583 B
PHP
--TEST--
|
|
Testing imagelayereffect() of GD library
|
|
--CREDITS--
|
|
Rafael Dohms <rdohms [at] gmail [dot] com>
|
|
#testfest PHPSP on 2009-06-20
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("gd")) die("skip GD not present");
|
|
if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$image = imagecreatetruecolor(180, 30);
|
|
|
|
$layer = imagelayereffect($image, IMG_EFFECT_REPLACE);
|
|
|
|
if ($layer){
|
|
ob_start();
|
|
imagegd($image);
|
|
$img = ob_get_contents();
|
|
ob_end_clean();
|
|
}
|
|
|
|
echo md5(base64_encode($img));
|
|
?>
|
|
--EXPECT--
|
|
da884f488a851e0267a316ad232aee86
|