mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 20:36:40 +02:00
47 lines
2.7 KiB
Diff
47 lines
2.7 KiB
Diff
diff --git a/tests/024-ispixelsimilar.phpt b/tests/024-ispixelsimilar.phpt
|
|
index 443b3f1..2840346 100644
|
|
--- a/tests/024-ispixelsimilar.phpt
|
|
+++ b/tests/024-ispixelsimilar.phpt
|
|
@@ -9,18 +9,18 @@ Test ImagickPixel::isPixelSimilar
|
|
$root3 = 1.732050807568877;
|
|
|
|
$tests = array(
|
|
- array ('rgb(245, 0, 0)', 'rgb(255, 0, 0)', 9 / $root3, false,),
|
|
+ array ('rgb(245, 0, 0)', 'rgb(255, 0, 0)', 7 / $root3, false,),
|
|
array ('rgb(245, 0, 0)', 'rgb(255, 0, 0)', 10 / $root3, true,),
|
|
- array ('rgb(0, 0, 0)', 'rgb(7, 7, 0)', 9 / $root3, false,),
|
|
+ array ('rgb(0, 0, 0)', 'rgb(7, 7, 0)', 6 / $root3, false,),
|
|
array ('rgb(0, 0, 0)', 'rgb(7, 7, 0)', 10 / $root3, true,),
|
|
- array ('rgba(0, 0, 0, 1)', 'rgba(7, 7, 0, 1)', 9 / $root3, false,),
|
|
+ array ('rgba(0, 0, 0, 1)', 'rgba(7, 7, 0, 1)', 6 / $root3, false,),
|
|
array ('rgba(0, 0, 0, 1)', 'rgba(7, 7, 0, 1)', 10 / $root3, true,),
|
|
- array ('rgb(128, 128, 128)', 'rgb(128, 128, 120)', 7 / $root3, false,),
|
|
+ array ('rgb(128, 128, 128)', 'rgb(128, 128, 120)', 5 / $root3, false,),
|
|
array ('rgb(128, 128, 128)', 'rgb(128, 128, 120)', 8 / $root3, true,),
|
|
|
|
- array ('rgb(0, 0, 0)', 'rgb(255, 255, 255)', 254.9, false,),
|
|
+ array ('rgb(0, 0, 0)', 'rgb(255, 255, 255)', 180, false,),
|
|
array ('rgb(0, 0, 0)', 'rgb(255, 255, 255)', 255, true,),
|
|
- array ('rgb(255, 0, 0)', 'rgb(0, 255, 255)', 254.9, false,),
|
|
+ array ('rgb(255, 0, 0)', 'rgb(0, 255, 255)', 180, false,),
|
|
array ('rgb(255, 0, 0)', 'rgb(0, 255, 255)', 255, true,),
|
|
array ('black', 'rgba(0, 0, 0)', 0.0, true),
|
|
array ('black', 'rgba(10, 0, 0, 1.0)', 10.0 / $root3, true),
|
|
@@ -39,12 +39,14 @@ try {
|
|
|
|
$isSimilar = $color1Pixel->isPixelSimilarQuantum($color2Pixel, $testDistance * \Imagick::getquantum());
|
|
if ($isSimilar !== $expectation) {
|
|
- echo "isSimilar failed. Color [$color1] compared to color [$color2] distance $testDistance doesn't meet expected result [$expectation].". PHP_EOL;
|
|
+ $exp = $expectation ? "true" : "false";
|
|
+ echo "isSimilar failed. Color [$color1] compared to color [$color2] distance $testDistance doesn't meet expected result [$exp].". PHP_EOL;
|
|
}
|
|
|
|
$isPixelSimilar = $color1Pixel->isPixelSimilar($color2Pixel, $testDistance);
|
|
if ($isPixelSimilar !== $expectation) {
|
|
- echo "isPixelSimilar failed. Color [$color1] compared to color [$color2] distance $testDistance doesn't meet expected result [$expectation].". PHP_EOL;
|
|
+ $exp = $expectation ? "true" : "false";
|
|
+ echo "isPixelSimilar failed. Color [$color1] compared to color [$color2] distance $testDistance doesn't meet expected result [$exp].". PHP_EOL;
|
|
}
|
|
}
|
|
echo "success";
|