|
...
|
...
|
@@ -105,8 +105,12 @@ class ImageController extends Controller |
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定图片不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
//查看缩略图是否存在
|
|
|
|
$filename = $this->config['root'] . '/' .$info['path'] . '_' . $w . '_' . $h;
|
|
|
|
if($info['is_cos'] == 1){
|
|
|
|
$filename = getImageUrl($info['path']);
|
|
|
|
}else{
|
|
|
|
//查看缩略图是否存在
|
|
|
|
$filename = $this->config['root'] . $info['path'] . '_' . $w . '_' . $h;
|
|
|
|
}
|
|
|
|
if(is_file($filename)){
|
|
|
|
$content = file_get_contents($filename);
|
|
|
|
$header['Content-Length'] = strlen($content);
|
|
...
|
...
|
@@ -127,7 +131,7 @@ class ImageController extends Controller |
|
|
|
*/
|
|
|
|
public function readImageContent($info,$w,$h)
|
|
|
|
{
|
|
|
|
$path = $this->config['root'] . '/' . $info['path'];
|
|
|
|
$path = $this->config['root'] . $info['path'];
|
|
|
|
if (!is_file($path)) {
|
|
|
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
|
|
|
}
|
...
|
...
|
|