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