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