mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
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.
34 lines
701 B
PHP
34 lines
701 B
PHP
--TEST--
|
|
Testing imageconvolution() of GD library
|
|
--CREDITS--
|
|
Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
|
|
#testfest PHPSP on 2009-06-20
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("gd")) die("skip GD not present");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$image = imagecreatetruecolor(180, 30);
|
|
|
|
// Writes the text and apply a gaussian blur on the image
|
|
imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
|
|
|
|
$gaussian = array(
|
|
array(1.0, 2.0, 1.0),
|
|
array(2.0, 4.0, 2.0),
|
|
array(1.0, 2.0, 1.0)
|
|
);
|
|
|
|
imageconvolution($image, $gaussian, 16, 0);
|
|
|
|
ob_start();
|
|
imagegd($image);
|
|
$img = ob_get_contents();
|
|
ob_end_clean();
|
|
|
|
echo md5(base64_encode($img));
|
|
?>
|
|
--EXPECT--
|
|
20979b45f8772cdbd78262af4e332638
|