Scales the size of an image to the given dimensions. The other parameter will be calculated if 0 is passed as either param.
function scaleImage($image_path)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->scaleImage(150, 150, true);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}