<?php
bool public Imagick::adaptiveResizeImage(
int $columns,
int $rows,
bool $bestfit = false,
bool $legacy = false
);
?>
<?php
// Run several times
$img1 = new Imagick();
$jpgfn = PATH2IMGW . '/jpg/1.jpg';
$str1img = 'img/jpg/1r.jpg';
$img1->readImage($jpgfn);
$columns = mt_rand(1, 799);
$rows = mt_rand(1, 999);
$bestfit = mt_rand(0,1);
$legacy = mt_rand(0,1);
echo "adaptiveResizeImage($columns, $rows, $bestfit, $legacy);<br>";
$img1->adaptiveResizeImage($columns, $rows, $bestfit, $legacy);
$strg = $img1->getImageBlob();
$img = imagecreatefromstring($strg);
imagejpeg($img, $str1img);
echo '<br>' . basename($str1img); ?>
<br><br>
<img src="<?php echo $str1img; ?>"
alt="<?php echo $str1img; ?>"
title="<?php echo $str1img; ?>">