php在新浪云中使用imagick的办法
发布时间:2022-02-23 18:51:55 所属栏目:PHP教程 来源:互联网
导读:php在新浪云中使用imagick生成缩略图并上传到Storage的方法 ?php //缩略图 $tmpFile =http://Cuoxin.com/original.jpg ; list($width, $height) = getimagesize($tmpFile); // resize if necessary if ($width = 550 $height = 550) { $image = new Imagick(
php在新浪云中使用imagick生成缩略图并上传到Storage的方法 <?php //缩略图 $tmpFile ='http://Cuoxin.com/original.jpg' ; list($width, $height) = getimagesize($tmpFile); // resize if necessary if ($width >= 550 && $height >= 550) { $image = new Imagick($tmpFile); $image->thumbnailImage(550, 550,true); /* 上传文件到Storage */ $st = new SaeStorage(); $tmp_url = SAE_TMP_PATH.time();//保存到sae临时目录 file_put_contents($tmp_url,$image); $path='/201608/22/1471856203_98548400.jpg'; if (!$st->upload('upload', $path, $tmp_url)) { echo 0; } else { echo $st->getUrl('upload', $path); }//Cuoxin.com } ?> (编辑:ASP站长) 【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。 |
相关内容
未处理完善
-
无相关信息
最新更新