php在线运行_php在新浪云中使用imagick的方法

时间:2020-11-10  来源:php正则表达式  阅读:

php在新浪云中使用imagick生成缩略图并上传到Storage的方法
//缩略图
    $tmpFile ="http://phpff.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);
        }
    }
?>

php在线运行_php在新浪云中使用imagick的方法

http://m.bbyears.com/jiaocheng/109666.html

推荐访问:php在线测试 php在线解密 php在底层转编码 php在线加密 php正则表达式 php在线 php在html中写假数据 php在windows上用什么安装
相关阅读 猜你喜欢
本类排行 本类最新