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