1--TEST-- 2Test Imagick, thresholdImage 3--SKIPIF-- 4<?php 5$imageMagickRequiredVersion=0x675; 6require_once(dirname(__FILE__) . '/skipif.inc'); 7?> 8--FILE-- 9<?php 10 11$threshold = 0.5; 12//$channel = Imagick::CHANNEL_DEFAULT; 13$channel = Imagick::CHANNEL_RED|Imagick::CHANNEL_GREEN|Imagick::CHANNEL_BLUE; 14 15function thresholdimage($threshold, $channel) { 16 $imagick = new \Imagick(); 17 $imagick->newPseudoImage(640, 480, "magick:logo"); 18 $imagick->thresholdimage($threshold * \Imagick::getQuantum(), $channel); 19 $bytes = $imagick->getImageBlob(); 20 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 21} 22 23thresholdimage($threshold, $channel) ; 24echo "Ok"; 25?> 26--EXPECTF-- 27Ok