mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
6d0e773292
Some issues have never been fixed in the external libgd's libvpx binding, so we skip the respective tests.
34 lines
846 B
PHP
34 lines
846 B
PHP
--TEST--
|
|
Bug #70102 (imagecreatefromwebm() shifts colors)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
|
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
|
|
die("skip test requires GD 2.2.0 or higher");
|
|
}
|
|
if (!function_exists('imagewebp') || !function_exists('imagecreatefromwebp'))
|
|
die('skip WebP support not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$filename = __DIR__ . '/bug70102.webp';
|
|
|
|
$im = imagecreatetruecolor(8, 8);
|
|
$white = imagecolorallocate($im, 255, 255, 255);
|
|
var_dump($white & 0xffffff);
|
|
imagefilledrectangle($im, 0, 0, 7, 7, $white);
|
|
imagewebp($im, $filename);
|
|
imagedestroy($im);
|
|
|
|
$im = imagecreatefromwebp($filename);
|
|
$color = imagecolorat($im, 4, 4);
|
|
var_dump($color & 0xffffff);
|
|
?>
|
|
--CLEAN--
|
|
<?php
|
|
unlink(__DIR__ . '/bug70102.webp');
|
|
?>
|
|
--EXPECT--
|
|
int(16777215)
|
|
int(16777215)
|