Width
Height
Image
Best fit
function adaptiveResizeImage($imagePath, $width, $height, $bestFit)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->adaptiveResizeImage($width, $height, $bestFit);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}