Redimensionnement PHP

function adaptiveResizeImage($image_path, $width, $height, $bestFit)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->adaptiveResizeImage($width, $height, $bestFit);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}
Abu Talha