1--TEST-- 2Test Imagick, quantizeImage 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7 8$numberColors = 64; 9$colorSpace = 1; 10$treeDepth = 0; 11$dither = 1; 12 13function quantizeImage($numberColors, $colorSpace, $treeDepth, $dither) { 14 $imagick = new \Imagick(); 15 $imagick->newPseudoImage(640, 480, "magick:logo"); 16 $imagick->quantizeImage($numberColors, $colorSpace, $treeDepth, $dither, false); 17 $imagick->setImageFormat('png'); 18 $bytes = $imagick->getImageBlob(); 19 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 20} 21 22quantizeImage($numberColors, $colorSpace, $treeDepth, $dither) ; 23echo "Ok"; 24?> 25--EXPECTF-- 26Ok