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