diff --git a/ext/gd/tests/imagecopyresampled_variation1.phpt b/ext/gd/tests/imagecopyresampled_variation1.phpt new file mode 100644 index 00000000000..98547f8931f --- /dev/null +++ b/ext/gd/tests/imagecopyresampled_variation1.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test for correct colors of imagecopyresampled() wrt. alpha +--SKIPIF-- + +--FILE-- +> 16; +$green = ($color & 0x00FF00) >> 8; +$blue = ($color & 0x0000FF); +$alpha = ($color & 0x7F000000) >> 24; + +/* test for expected component values */ +if (!($red >= EXP_RED - 1 && $red <= EXP_RED + 1)) { + printf("red: expected roughly %d, got %d\n", EXP_RED, $red); +} +if (!($green >= EXP_GREEN - 1 && $green <= EXP_GREEN + 1)) { + printf("green: expected roughly %d, got %d\n", EXP_GREEN, $green); +} +if (!($blue >= EXP_BLUE - 1 && $blue <= EXP_BLUE + 1)) { + printf("blue: expected roughly %d, got %d\n", EXP_BLUE, $blue); +} +if (!($alpha >= EXP_ALPHA - 1 && $alpha <= EXP_ALPHA + 1)) { + printf("alpha: expected roughly %d, got %d\n", EXP_ALPHA, $alpha); +} + +imagedestroy($copy); +imagedestroy($im); + +echo 'DONE'; +?> +--EXPECT-- +DONE