1--TEST-- 2Test Imagick, mergeImageLayers 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7 8$layerMethodType = 13; 9 10function mergeImageLayers($layerMethodType) { 11 12 $imagick = new \Imagick(); 13 $nextImage = null; 14 $imageNames = array( 15 "magick:NETSCAPE", 16 "magick:logo", 17 "magick:GRANITE", 18 ); 19 20 foreach ($imageNames as $imageName) { 21 $nextImage = new \Imagick(); 22 $nextImage->newPseudoImage(640, 480, $imageName); 23 $imagick->addImage($nextImage); 24 } 25 26 $imagick->resetIterator(); 27 28 $imagick->setImageFormat('png'); 29 30 $result = $imagick->mergeImageLayers($layerMethodType); 31 $bytes = $result->getImageBlob(); 32 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 33} 34 35mergeImageLayers($layerMethodType); 36echo "Ok"; 37?> 38--EXPECTF-- 39Ok