1--TEST-- 2Test Imagick, Imagick::evaluateImages 3--SKIPIF-- 4<?php 5 6require_once(dirname(__FILE__) . '/skipif.inc'); 7?> 8--FILE-- 9<?php 10 11function im_check($value) { 12 static $count = 0; 13 14 if (abs($value - 0.5) > 0.0000001) { 15 echo "Unexpected value of $value for check $count\n"; 16 } 17 18 $count++; 19} 20 21 22$imagick = new \Imagick(); 23$imagick->newPseudoImage(640, 480, "magick:logo"); 24 25$imagick->setImageFormat('png'); 26$v = Imagick::getVersion(); 27if ($v['versionNumber'] < 0x700) { 28 $imagick->setImageRedPrimary(0.5, 0.5); 29 $imagick->setImageGreenPrimary(0.5, 0.5); 30 $imagick->setImageBluePrimary(0.5, 0.5); 31 $imagick->setImageWhitePoint(0.5, 0.5); 32 33 $color = $imagick->getImageRedPrimary(); 34 im_check($color['x']);im_check($color['y']); 35 36 $color = $imagick->getImageGreenPrimary(); 37 im_check($color['x']);im_check($color['y']); 38 39 $color = $imagick->getImageBluePrimary(); 40 im_check($color['x']);im_check($color['y']); 41 42 $color = $imagick->getImageWhitePoint(); 43 im_check($color['x']);im_check($color['y']); 44} 45else { 46 $imagick->setImageRedPrimary(0.5, 0.5, 0.5); 47 $imagick->setImageGreenPrimary(0.5, 0.5, 0.5); 48 $imagick->setImageBluePrimary(0.5, 0.5, 0.5); 49 $imagick->setImageWhitePoint(0.5, 0.5, 0.5); 50 51 $color = $imagick->getImageRedPrimary(); 52 im_check($color['x']);im_check($color['y']);im_check($color['z']); 53 54 $color = $imagick->getImageGreenPrimary(); 55 im_check($color['x']);im_check($color['y']);im_check($color['z']); 56 57 $color = $imagick->getImageBluePrimary(); 58 im_check($color['x']);im_check($color['y']);im_check($color['z']); 59 60 $color = $imagick->getImageWhitePoint(); 61 im_check($color['x']);im_check($color['y']);im_check($color['z']); 62} 63 64 65echo "Ok"; 66?> 67--EXPECTF-- 68Ok