mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
a375d54785
Cf. PR #6787. Closes GH-6994.
30 lines
999 B
PHP
30 lines
999 B
PHP
--TEST--
|
|
Bug #79676 (imagescale adds black border with IMG_BICUBIC)
|
|
--EXTENSIONS--
|
|
gd
|
|
--FILE--
|
|
<?php
|
|
function test($image, $desc)
|
|
{
|
|
echo "$desc - Test Result: ",
|
|
(imagecolorat($image, imagesx($image) - 1 , imagesy($image) - 1) != 0x000000 ? 'pass' : 'fail'),
|
|
PHP_EOL;
|
|
}
|
|
|
|
$size = 32;
|
|
$src = imagecreatetruecolor($size, $size);
|
|
imagefilledrectangle($src, 0, 0, $size - 1 , $size - 1, 0xff00ff);
|
|
|
|
test($src, 'No scaling');
|
|
test(imagescale($src, $size * 2, $size * 2), 'Scale 200%, default mode');
|
|
test(imagescale($src, $size / 2, $size / 2), 'Scale 50%, default mode');
|
|
test(imagescale($src, $size * 2, $size * 2, IMG_BICUBIC), 'Scale 200%, IMG_BICUBIC mode');
|
|
test(imagescale($src, $size / 2, $size / 2, IMG_BICUBIC), 'Scale 50%, IMG_BICUBIC mode');
|
|
?>
|
|
--EXPECT--
|
|
No scaling - Test Result: pass
|
|
Scale 200%, default mode - Test Result: pass
|
|
Scale 50%, default mode - Test Result: pass
|
|
Scale 200%, IMG_BICUBIC mode - Test Result: pass
|
|
Scale 50%, IMG_BICUBIC mode - Test Result: pass
|