php imagick压缩网络图片的方法
作者:互联网
php imagick压缩网络图片的方法
$rawimg = $v['fengmiantu']; $watermark = new \Imagick(); $info = file_get_contents($rawimg); $watermark->readImageBlob($info); $watermark->scaleImage(300, 9999, true); $filename = $this->msectime() . rand(100, 999); $destpath = $this->getxiangmupath1() . '/' . $filename . '.jpg'; $watermark->setImageFormat('jpg'); $watermark->writeImage($destpath); $weburl='http://111/upload/caitonglianjie/' . $filename . '.jpg'; $sql='update 111set fengmiantu=?,isupdate=1 where id=?'; $this->commonexecute($sql,array($weburl,$v['id']));
标签:watermark,压缩,weburl,jpg,filename,imagick,php,id 来源: https://www.cnblogs.com/newmiracle/p/15530068.html