php使用imagick生成缩略图的方法

<?php
    //缩略图
    $tmpFile ='$_FILES["file"]["tmp_name"];
    $fileName='fileName.jpg';
    list($width, $height) = getimagesize($tmpFile);
    
    // resize if necessary
    if ($width >= 550 && $height >= 550) {
        $image = new Imagick($tmpFile);
        $image->thumbnailImage(550, 550,true);
        $image->writeImage($fileName);
    }
?>
参考:
https://www.sitepoint.com/crop-and-resize-images-with-imagemagick/

http://www.php.net/manual/en/imagick.thumbnailimage.php