Submit
Path:
~
/
/
opt
/
cpanel
/
ea-php72
/
root
/
usr
/
share
/
tests
/
pecl
/
imagick
/
tests
/
File Content:
024-ispixelsimilar.phpt
--TEST-- Test ImagickPixel::isPixelSimilar --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); --FILE-- <?php $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)', 10 / $root3, true,), array ('rgb(0, 0, 0)', 'rgb(7, 7, 0)', 9 / $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)', 10 / $root3, true,), array ('rgb(128, 128, 128)', 'rgb(128, 128, 120)', 7 / $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)', 255, true,), array ('rgb(255, 0, 0)', 'rgb(0, 255, 255)', 254.9, 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), ); try { foreach ($tests as $testInfo) { $color1 = $testInfo[0]; $color2 = $testInfo[1]; $distance = $testInfo[2]; $expectation = $testInfo[3]; $testDistance = ($distance / 255.0); $color1Pixel = new ImagickPixel($color1); $color2Pixel = new ImagickPixel($color2); $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; } $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; } } echo "success"; } catch (\Exception $e) { echo "Exception caught in ImagickPixel::isPixelSimilar test: ".$e->getMessage() . PHP_EOL; } ?> --EXPECT-- success
Submit
FILE
FOLDER
Name
Size
Permission
Action
001_imagick_readimage.phpt
349 bytes
0644
002_thumbnail.phpt
3881 bytes
0644
003_cast_color_opacity.phpt
877 bytes
0644
004_clone.phpt
506 bytes
0644
005_bestfit.phpt
320 bytes
0644
006_cropthumbnail.phpt
1133 bytes
0644
007_thumbnail_fill.phpt
808 bytes
0644
008_newpseudoimage.phpt
823 bytes
0644
009_properties.phpt
329 bytes
0644
010_importimagepixels.phpt
1133 bytes
0644
011_polygon.phpt
484 bytes
0644
012-clone-separation.phpt
542 bytes
0644
013-read-filehandle.phpt
441 bytes
0644
014-setresourcelimit.phpt
2129 bytes
0644
015-imagickdrawsetresolution.phpt
1571 bytes
0644
016-static-methods.phpt
393 bytes
0644
017-clear-destroy.phpt
447 bytes
0644
018-clone-length.phpt
683 bytes
0644
019-readimages.phpt
937 bytes
0644
020-pixeliterator.phpt
1868 bytes
0644
021-countable.phpt
357 bytes
0644
022-writeimagefileformat.phpt
1625 bytes
0644
024-ispixelsimilar.phpt
2251 bytes
0644
025-function-image.phpt
260 bytes
0644
025-get-color.phpt
3411 bytes
0644
026_phpinfo.phpt
380 bytes
0644
027_Imagick_adaptiveResizeImage_basic.phpt
601 bytes
0644
028_Imagick_adaptiveSharpenImage_basic.phpt
623 bytes
0644
029_Imagick_adaptiveBlurImage_basic.phpt
611 bytes
0644
030_Imagick_adaptiveThresholdImage_basic.phpt
728 bytes
0644
031_Imagick_affineTransformImage_basic.phpt
3960 bytes
0644
032_Imagick_addNoiseImage_basic.phpt
570 bytes
0644
033_Imagick_autoLevelImage_basic.phpt
462 bytes
0644
034_Imagick_annotateImage_basic.phpt
1000 bytes
0644
035_Imagick_blackThresholdImage_basic.phpt
566 bytes
0644
036_Imagick_blueShiftImage_basic.phpt
509 bytes
0644
037_Imagick_blurImage_basic.phpt
578 bytes
0644
038_Imagick_brightnessContrastImage_basic.phpt
666 bytes
0644
039_Imagick_borderImage_basic.phpt
576 bytes
0644
040_Imagick_charcoalImage_basic.phpt
527 bytes
0644
041_Imagick_chopImage_basic.phpt
596 bytes
0644
042_Imagick_clutImage_basic.phpt
634 bytes
0644
043_Imagick_colorizeImage_basic.phpt
1066 bytes
0644
044_Imagick_colorMatrixImage_basic.phpt
1543 bytes
0644
045_Imagick_compositeImage_basic.phpt
1066 bytes
0644
046_Imagick_contrastImage_basic.phpt
556 bytes
0644
047_Imagick_convolveImage_6.phpt
875 bytes
0644
047_Imagick_convolveImage_7.phpt
671 bytes
0644
048_Imagick_cropImage_basic.phpt
595 bytes
0644
049_Imagick_deskewImage_basic.phpt
1642 bytes
0644
050_Imagick_distortImage_Affine.phpt
773 bytes
0644
051_Imagick_distortImage_Projection.phpt
758 bytes
0644
052_Imagick_distortImage_Arc.phpt
993 bytes
0644
053_Imagick_distortImage_RotatedArc.phpt
694 bytes
0644
054_Imagick_distortImage_Bilinear.phpt
848 bytes
0644
055_Imagick_distortImage_ScaleRotateTransform.phpt
709 bytes
0644
056_Imagick_distortImage_Perspective.phpt
1447 bytes
0644
057_Imagick_distortImage_PerspectiveProjection.phpt
990 bytes
0644
058_Imagick_distortImage_Polynomial.phpt
1342 bytes
0644
059_Imagick_distortImage_Polar.phpt
813 bytes
0644
060_Imagick_distortImage_Polar.phpt
677 bytes
0644
061_Imagick_distortImage_Barrel.phpt
1317 bytes
0644
062_Imagick_distortImage_BarrelInverse.phpt
876 bytes
0644
063_Imagick_distortImage_Shepards.phpt
1991 bytes
0644
064_cropThumbNailImage.phpt
1979 bytes
0644
065_Imagick_despeckleImage_basic.phpt
461 bytes
0644
066_Imagick_embossImage_basic.phpt
519 bytes
0644
067_Imagick_edgeImage_basic.phpt
475 bytes
0644
068_Imagick_enhanceImage_basic.phpt
453 bytes
0644
069_Imagick_equalizeImage_case1.phpt
457 bytes
0644
070_Imagick_equalizeImage_case2.phpt
701 bytes
0644
071_Imagick_flipImage_basic.phpt
441 bytes
0644
072_Imagick_evaluateImage_basic.phpt
3094 bytes
0644
073_Imagick_forwardFourierTransformImage_basic.phpt
1818 bytes
0644
074_Imagick_flopImage_basic.phpt
442 bytes
0644
075_Imagick_floodFillPaintImage_basic.phpt
891 bytes
0644
076_Imagick_fxImage_basic.phpt
579 bytes
0644
077_Imagick_frameImage_basic.phpt
830 bytes
0644
078_Imagick_gammaImage_basic.phpt
544 bytes
0644
079_Imagick_getImageGeometry_basic.phpt
435 bytes
0644
080_Imagick_gaussianBlurImage_basic.phpt
610 bytes
0644
081_Imagick_getImageHistogram_basic.phpt
2927 bytes
0644
083_Imagick_getPixelIterator_basic.phpt
1012 bytes
0644
084_Imagick_getPixelRegionIterator_basic.phpt
1054 bytes
0644
085_Imagick_haldClutImage_basic.phpt
618 bytes
0644
086_Imagick_forwardFourierTransformImage_basic.phpt
1781 bytes
0644
087_Imagick_levelImage_basic.phpt
663 bytes
0644
088_Imagick_implodeImage_basic.phpt
460 bytes
0644
089_Imagick_medianFilterImage_basic.phpt
566 bytes
0644
090_Imagick_magnifyImage_basic.phpt
453 bytes
0644
091_Imagick_linearStretchImage_basic.phpt
710 bytes
0644
092_Imagick_mergeImageLayers_basic.phpt
857 bytes
0644
093_Imagick_modulateImage_basic.phpt
597 bytes
0644
094_Imagick_motionBlurImage_basic.phpt
641 bytes
0644
095_Imagick_normalizeImage_basic.phpt
720 bytes
0644
096_Imagick_negateImage_basic.phpt
558 bytes
0644
097_Imagick_newPseudoImage_basic.phpt
482 bytes
0644
098_Imagick_orderedPosterizeImage_basic.phpt
766 bytes
0644
099_Imagick_oilPaintImage_basic.phpt
491 bytes
0644
100_Imagick_posterizeImage_basic.phpt
589 bytes
0644
101_Imagick_quantizeImage_basic.phpt
673 bytes
0644
102_Imagick_radialBlurImage_basic.phpt
779 bytes
0644
103_Imagick_readImageBlob_basic.phpt
1090 bytes
0644
104_Imagick_randomThresholdImage_basic.phpt
763 bytes
0644
105_Imagick_raiseImage_basic.phpt
622 bytes
0644
106_Imagick_reduceNoiseImage_basic.phpt
581 bytes
0644
107_Imagick_recolorImage_basic.phpt
603 bytes
0644
108_Imagick_resampleImage_basic.phpt
495 bytes
0644
109_Imagick_rollImage_basic.phpt
511 bytes
0644
110_Imagick_resizeImage_basic.phpt
1328 bytes
0644
111_Imagick_rotateImage_basic.phpt
535 bytes
0644
112_Imagick_roundCorners_basic.phpt
931 bytes
0644
113_Imagick_rotationalBlurImage_basic.phpt
586 bytes
0644
114_Imagick_scaleImage_basic.phpt
970 bytes
0644
115_Imagick_selectiveBlurImage_basic.phpt
668 bytes
0644
116_Imagick_separateImageChannel_basic.phpt
546 bytes
0644
117_Imagick_segmentImage_basic.phpt
659 bytes
0644
118_Imagick_setImageArtifact_basic.phpt
768 bytes
0644
119_Imagick_sepiaToneImage_basic.phpt
492 bytes
0644
120_Imagick_setCompressionQuality_basic.phpt
898 bytes
0644
121_Imagick_setImageBias_basic.phpt
871 bytes
0644
122_Imagick_setImageCompressionQuality_basic.phpt
550 bytes
0644
123_Imagick_setImageClipMask_basic.phpt
1114 bytes
0644
125_Imagick_setImageOrientation_basic.phpt
611 bytes
0644
126_Imagick_getImageChannelStats_basic.phpt
297 bytes
0644
127_Imagick_progressMonitor_basic.phpt
1148 bytes
0644
130_Imagick_setOption_case1.phpt
602 bytes
0644
131_Imagick_setOption_case2.phpt
515 bytes
0644
132_Imagick_setOption_case3.phpt
556 bytes
0644
133_Imagick_setSamplingFactors_basic.phpt
838 bytes
0644
134_Imagick_shadowImage_basic.phpt
463 bytes
0644
135_Imagick_sharpenImage_basic.phpt
590 bytes
0644
136_Imagick_shadeImage_basic.phpt
457 bytes
0644
137_Imagick_shearImage_basic.phpt
575 bytes
0644
138_Imagick_shaveImage_basic.phpt
452 bytes
0644
139_Imagick_sigmoidalContrastImage_basic.phpt
786 bytes
0644
141_Imagick_sketchImage_basic.phpt
556 bytes
0644
142_Imagick_solarizeImage_basic.phpt
562 bytes
0644
143_Imagick_spreadImage_basic.phpt
483 bytes
0644
144_Imagick_spliceImage_basic.phpt
603 bytes
0644
145_imagickkernel_coverage.phpt
4555 bytes
0644
149_Imagick_sparseColorImage.phpt
4048 bytes
0644
150_Imagick_setregistry.phpt
1560 bytes
0644
151_Imagick_subImageMatch_basic.phpt
1617 bytes
0644
152_Imagick_swirlImage_basic.phpt
477 bytes
0644
153_Imagick_statisticImage_basic.phpt
709 bytes
0644
154_Imagick_textureImage_basic.phpt
628 bytes
0644
155_Imagick_thresholdImage_basic.phpt
681 bytes
0644
156_Imagick_tintImage_basic.phpt
665 bytes
0644
157_Imagick_thumbnailImage_basic.phpt
534 bytes
0644
158_Imagick_transposeImage_basic.phpt
461 bytes
0644
159_Imagick_transformImage_basic.phpt
611 bytes
0644
160_Imagick_transparentPaintImage_basic.phpt
802 bytes
0644
161_Imagick_transformImageColorspace_basic.phpt
654 bytes
0644
162_Imagick_transverseImage_basic.phpt
465 bytes
0644
163_Imagick_uniqueImageColors_basic.phpt
682 bytes
0644
164_Imagick_trimImage_basic.phpt
589 bytes
0644
165_Imagick_unsharpMaskImage_basic.phpt
696 bytes
0644
166_Imagick_waveImage_basic.phpt
528 bytes
0644
167_Imagick_vignetteImage_basic.phpt
607 bytes
0644
168_Imagick_whiteThresholdImage_basic.phpt
557 bytes
0644
169_ImagickPixel_construct_basic.phpt
1874 bytes
0644
170_ImagickPixel_setColor_basic.phpt
761 bytes
0644
171_ImagickPixel_setColorValue_basic.phpt
719 bytes
0644
172_ImagickPixel_setColorValueQuantum_basic.phpt
846 bytes
0644
173_ImagickDraw_bezier_basic.phpt
2283 bytes
0644
174_ImagickDraw_affine_basic.phpt
2280 bytes
0644
175_ImagickDraw_arc_basic.phpt
1290 bytes
0644
176_ImagickDraw_ellipse_basic.phpt
1165 bytes
0644
177_ImagickDraw_composite_basic.phpt
1733 bytes
0644
178_ImagickDraw_circle_basic.phpt
1158 bytes
0644
179_ImagickDraw_line_basic.phpt
864 bytes
0644
180_ImagickDraw_matte_basic.phpt
1036 bytes
0644
181_ImagickDraw_pathStart_basic.phpt
1526 bytes
0644
182_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
1918 bytes
0644
183_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
1918 bytes
0644
184_ImagickDraw_polyline_basic.phpt
1035 bytes
0644
185_ImagickDraw_point_basic.phpt
760 bytes
0644
186_ImagickDraw_polygon_basic.phpt
1033 bytes
0644
187_ImagickDraw_push_basic.phpt
1061 bytes
0644
188_ImagickDraw_pushPattern_basic.phpt
1515 bytes
0644
189_ImagickDraw_setClipPath_basic.phpt
1231 bytes
0644
190_ImagickDraw_popDefs_basic.phpt
995 bytes
0644
191_ImagickDraw_push_basic.phpt
1061 bytes
0644
192_ImagickDraw_setClipPath_basic.phpt
1038 bytes
0644
193_ImagickDraw_pushPattern_basic.phpt
1515 bytes
0644
194_ImagickDraw_rectangle_basic.phpt
951 bytes
0644
195_ImagickDraw_rotate_basic.phpt
985 bytes
0644
196_ImagickDraw_scale_basic.phpt
986 bytes
0644
197_ImagickDraw_roundRectangle_basic.phpt
1086 bytes
0644
198_ImagickDraw_setClipPath_basic.phpt
1038 bytes
0644
199_ImagickDraw_setClipRule_basic.phpt
1387 bytes
0644
200_ImagickDraw_setClipUnits_basic.phpt
1170 bytes
0644
201_ImagickDraw_setFillAlpha_basic.phpt
933 bytes
0644
202_ImagickDraw_setFillColor_basic.phpt
938 bytes
0644
203_ImagickDraw_setFillRule_basic.phpt
1714 bytes
0644
204_ImagickDraw_setFillOpacity_basic.phpt
942 bytes
0644
206_ImagickDraw_setFontSize_basic.phpt
1122 bytes
0644
207_ImagickDraw_setFontFamily_basic.phpt
1436 bytes
0644
208_ImagickDraw_setFontStretch_basic.phpt
1422 bytes
0644
209_ImagickDraw_setFontWeight_basic.phpt
1260 bytes
0644
210_ImagickDraw_setFontStyle_basic.phpt
1228 bytes
0644
211_ImagickDraw_setStrokeAntialias_basic.phpt
1020 bytes
0644
212_ImagickDraw_setGravity_basic.phpt
1475 bytes
0644
213_ImagickDraw_setStrokeAlpha_basic.phpt
975 bytes
0644
214_ImagickDraw_setStrokeDashOffset_basic.phpt
1264 bytes
0644
215_ImagickDraw_setStrokeColor_basic.phpt
978 bytes
0644
216_ImagickDraw_setStrokeDashArray_basic.phpt
1326 bytes
0644
217_ImagickDraw_setStrokeMiterLimit_basic.phpt
1444 bytes
0644
218_ImagickDraw_setStrokeLineCap_basic.phpt
1089 bytes
0644
219_ImagickDraw_setStrokeLineJoin_basic.phpt
1392 bytes
0644
220_ImagickDraw_setStrokeOpacity_basic.phpt
1153 bytes
0644
221_ImagickDraw_setStrokeWidth_basic.phpt
970 bytes
0644
222_ImagickDraw_setTextAlignment_basic.phpt
1284 bytes
0644
223_ImagickDraw_setTextAntialias_basic.phpt
1219 bytes
0644
224_ImagickDraw_setTextUnderColor_basic.phpt
1158 bytes
0644
225_ImagickDraw_setTextDecoration_basic.phpt
1100 bytes
0644
226_ImagickDraw_setViewBox_basic.phpt
1326 bytes
0644
227_ImagickDraw_skewY_basic.phpt
1168 bytes
0644
228_ImagickDraw_skewX_basic.phpt
1172 bytes
0644
229_Tutorial_fxAnalyzeImage_case1.phpt
2422 bytes
0644
234_Tutorial_edgeExtend_basic.phpt
1538 bytes
0644
235_ImagickDraw_translate_basic.phpt
1244 bytes
0644
236_Imagick_identify_basic.phpt
670 bytes
0644
237_Tutorial_deconstructGif_basic.phpt
2041 bytes
0644
239_Tutorial_gradientReflection_basic.phpt
1353 bytes
0644
240_Tutorial_imagickCompositeGen_basic.phpt
4281 bytes
0644
241_Tutorial_psychedelicFont_basic.phpt
1189 bytes
0644
242_Tutorial_levelizeImage_basic.phpt
1019 bytes
0644
243_Tutorial_svgExample_basic.phpt
1358 bytes
0644
244_Tutorial_psychedelicFontGif_basic.phpt
1953 bytes
0644
245_Tutorial_screenEmbed_basic.phpt
1110 bytes
0644
246_antialias_image.phpt
446 bytes
0644
247_ImagickPixelIterator_construct_basic.phpt
984 bytes
0644
248_ImagickPixelIterator_clear_basic.phpt
1016 bytes
0644
249_ImagickPixelIterator_getNextIteratorRow_basic.phpt
1110 bytes
0644
250_ImagickPixelIterator_resetIterator_basic.phpt
1668 bytes
0644
251_ImagickPixelIterator_setIteratorRow_basic.phpt
1025 bytes
0644
252_ImagickPixelIterator_construct_basic.phpt
984 bytes
0644
253_getHdri.phpt
404 bytes
0644
254_getConfigureOptions.phpt
4317 bytes
0644
255_getFeatures.phpt
318 bytes
0644
256_Imagick_exportImagePixels_basic.phpt
1689 bytes
0644
257_Imagick_setImageChannelMask_basic.phpt
907 bytes
0644
258_Imagick_evaluateImages_basic.phpt
720 bytes
0644
259_Imagick_colorPoints_basic.phpt
1671 bytes
0644
260_localContrastImage.phpt
301 bytes
0644
261_compositeImageGravity.phpt
806 bytes
0644
262_autoOrient.phpt
427 bytes
0644
263_autoGammaImage.phpt
335 bytes
0644
264_ImagickDraw_getTextDirection_basic.phpt
1499 bytes
0644
265_ImagickDraw_getOpacity_basic.phpt
1058 bytes
0644
266_ImagickDraw_getFontResolution_basic.phpt
1852 bytes
0644
267_ImagickDraw_getBorderColor_basic.phpt
1159 bytes
0644
268_ImagickDraw_getDensity_basic.phpt
1059 bytes
0644
269_ImagickPixel_setColorFromPixel_basic.phpt
549 bytes
0644
270_imagick_restoreErrorHandler.phpt
574 bytes
0644
271_imagick_constants.phpt
323 bytes
0644
272_imagick_identifyimagetype.phpt
445 bytes
0644
273_imagick_falsyimage.phpt
304 bytes
0644
274_imagick_setImageAlpha.phpt
1900 bytes
0644
275_ImagickPixel_unitializedObjects.phpt
2197 bytes
0644
276_Imagick_artifacts.phpt
638 bytes
0644
277_Imagick_colorDecisionListImage.phpt
756 bytes
0644
278_Imagick_optimaze_gif.phpt
2325 bytes
0644
279_ImagickDraw_setTextInterlineSpacing.phpt
2061 bytes
0644
280_imagickkernel_exception_invalid_origin.phpt
2338 bytes
0644
281_imagick_houghLineImage_basic.phpt
736 bytes
0644
281_ini_settings_default.phpt
568 bytes
0644
282_ini_settings_set_falsy_string.phpt
1092 bytes
0644
283_ini_settings_set_falsy_zero.phpt
631 bytes
0644
284_ini_settings_set_truthy_number.phpt
645 bytes
0644
285_ini_settings_set_truthy_string.phpt
644 bytes
0644
286_Imagick_setMask_basic.phpt
1702 bytes
0644
287_Imagick_GetImageChannelRange_basic.phpt
1640 bytes
0644
288_imagick_prevent_zero_size_images.phpt
832 bytes
0644
289_Imagick_setImageMask_basic.phpt
1800 bytes
0644
anonymous_pro_minus.ttf
121704 bytes
0644
bug20636.phpt
779 bytes
0644
bug21229.phpt
690 bytes
0644
bug59378.phpt
1004 bytes
0644
bug64015.phpt
435 bytes
0644
bug_66098.phpt
223 bytes
0644
bug_71742.phpt
1009 bytes
0644
bug_72226.phpt
548 bytes
0644
bug_73840.phpt
1029 bytes
0644
functions.inc
3065 bytes
0644
github_174.phpt
290 bytes
0644
houghline_input_image.png
1608 bytes
0644
php.gif
2523 bytes
0644
skipif.inc
2737 bytes
0644
skipprobefourier.inc
479 bytes
0644
N4ST4R_ID | Naxtarrr