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