<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ <?php namespace Common\Common; class ImageEdit{ /** * [上傳圖片并生成縮略圖] * @param [type] $imgName [圖片提交的表單名稱] * @param [type] $dirName [圖片上傳的二級目錄] * @param array $thumb * [縮略圖生成,一個數組,傳幾個值生成幾個圖片] * @return [type] [description] */ static public function uploadOne($imgName, $dirName, $thumb = array()) { // 上傳LOGO if(isset($_FILES[$imgName]) && $_FILES[$imgName]['error'] == 0) { $ic = C('IMAGE_CONFIG'); $upload = new \Think\Upload(array( 'rootPath' => $ic['rootPath'], 'maxSize' => $ic['maxSize'], 'exts' => $ic['exts'], ));// 實例化上傳類 $upload->savePath = $dirName . '/'; // 圖片二級目錄的名稱 // 上傳時指定一個要上傳的圖片的名稱,否則會把表單中所有的圖片都處理,之后再想其他圖片時就再找不到圖片了 $info = $upload->upload(array($imgName=>$_FILES[$imgName])); if(!$info) { return array( 'ok' => 0, 'error' => $upload->getError(), ); } else { $ret['ok'] = 1; $ret['images'][0] = $logoName = $info[$imgName]['savepath'] . $info[$imgName]['savename']; // 判斷是否生成縮略圖 if($thumb) { $image = new \Think\Image(); // 循環生成縮略圖 foreach ($thumb as $k => $v) { $ret['images'][$k+1] = $info[$imgName]['savepath'] . 'thumb_'.$k.'_' .$info[$imgName]['savename']; // 打開要處理的圖片 $image->open($ic['rootPath'].$logoName); $image->thumb($v[0], $v[1])->save($ic['rootPath'].$ret['images'][$k+1]); } } return $ret; } } } /******************************************************* * 上傳圖片并生成縮略圖使用方法 * 用法: * $ret=uploadOne('logo','Goods',array( * array(600,600), * array(300,300), * array(100,100), * * )); * 返回值: * if($ret['ok']==1){ * $ret['images'][0]; //原圖地址 * $ret['images'][1]; //第一個縮略圖地址 * $ret['images'][2]; //第二個縮略圖地址 * $ret['images'][3]; //第三個縮略圖地址 * }else{ * $this->error=$ret['error']; * return false; * } ****************************************************/ /** * [delImage 刪除圖片函數] * @param [type] $img [圖片文件名數組] * @return [type] [description] */ static public function delImage($img){ foreach ($img as $k => $v) { unlink(C('IMAGE_CONFIG')['rootPath'].$v); } } /** * [showImage 顯示圖片函數] * @param [type] $url [圖片名稱] * @param string $width [顯示寬度] * @param string $heigt [顯示高度] * @return [type] [description] */ function showImage($url,$width='',$heigt=''){ $pt=C('IMAGE_CONFIG'); if($width) $width="width='{$width}'"; if($heigt) $height="height='{$height}'"; echo "<img $width $height src='{$pt['viewPath']}$url' />"; } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看