|
@@ -105,8 +105,12 @@ class ImageController extends Controller |
|
@@ -105,8 +105,12 @@ class ImageController extends Controller |
|
105
|
if ($info === false) {
|
105
|
if ($info === false) {
|
|
106
|
$this->response('指定图片不存在!', Code::USER_ERROR);
|
106
|
$this->response('指定图片不存在!', Code::USER_ERROR);
|
|
107
|
}
|
107
|
}
|
|
108
|
- //查看缩略图是否存在
|
|
|
|
109
|
- $filename = $this->config['root'] . '/' .$info['path'] . '_' . $w . '_' . $h;
|
108
|
+ if($info['is_cos'] == 1){
|
|
|
|
109
|
+ $filename = getImageUrl($info['path']);
|
|
|
|
110
|
+ }else{
|
|
|
|
111
|
+ //查看缩略图是否存在
|
|
|
|
112
|
+ $filename = $this->config['root'] . $info['path'] . '_' . $w . '_' . $h;
|
|
|
|
113
|
+ }
|
|
110
|
if(is_file($filename)){
|
114
|
if(is_file($filename)){
|
|
111
|
$content = file_get_contents($filename);
|
115
|
$content = file_get_contents($filename);
|
|
112
|
$header['Content-Length'] = strlen($content);
|
116
|
$header['Content-Length'] = strlen($content);
|
|
@@ -127,7 +131,7 @@ class ImageController extends Controller |
|
@@ -127,7 +131,7 @@ class ImageController extends Controller |
|
127
|
*/
|
131
|
*/
|
|
128
|
public function readImageContent($info,$w,$h)
|
132
|
public function readImageContent($info,$w,$h)
|
|
129
|
{
|
133
|
{
|
|
130
|
- $path = $this->config['root'] . '/' . $info['path'];
|
134
|
+ $path = $this->config['root'] . $info['path'];
|
|
131
|
if (!is_file($path)) {
|
135
|
if (!is_file($path)) {
|
|
132
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
136
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
|
133
|
}
|
137
|
}
|