1--TEST--
2Test Imagick, levelImage
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7
8$blackPoint = 50;
9$whitePoint = 100;
10$gamma = 2.2;
11
12function levelImage($blackPoint, $gamma, $whitePoint) {
13    $imagick = new \Imagick();
14    $imagick->newPseudoimage(500, 500, 'gradient:black-white');
15
16    $imagick->setFormat('png');
17    $quantum = $imagick->getQuantum();
18    $imagick->levelImage($blackPoint / 100 , $gamma, $quantum * $whitePoint / 100);
19
20    $bytes = $imagick->getImageBlob();
21    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
22}
23
24levelImage($blackPoint, $gamma, $whitePoint) ;
25echo "Ok";
26?>
27--EXPECTF--
28Ok