|
...
|
...
|
@@ -59,23 +59,23 @@ class ImageController |
|
|
|
[$last_modified_time, $hash . ':' . $w . '_' . $h . '_' . 2, $last_modified_time], $this->upload_img['header']);
|
|
|
|
$content = file_get_contents($filename);
|
|
|
|
$header['Content-Length'] = $info['size'];
|
|
|
|
return response($content, 200, $header);
|
|
|
|
}
|
|
|
|
$path = $info['path'];
|
|
|
|
if (!is_file($path)) {
|
|
|
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$content = '';
|
|
|
|
$last_modified_time = gmdate(time() + ((30 * 60 * 60 * 24))) . " GMT";
|
|
|
|
$header = str_replace(['%Expires%', "%etag%", '%Last-Modified%'],
|
|
|
|
[$last_modified_time, $hash . ':' . $w . '_' . $h . '_' . 2, $last_modified_time], $this->upload_img['header']);
|
|
|
|
if ($w > 0 && $h > 0) {
|
|
|
|
$path = $this->cacheImage($info, $w, $h);
|
|
|
|
$content = file_get_contents($path);
|
|
|
|
$header['Content-Length'] = strlen($content);
|
|
|
|
} else {
|
|
|
|
$content = file_get_contents($path);
|
|
|
|
$header['Content-Length'] = $info['size'];
|
|
|
|
}else{
|
|
|
|
$path = $info['path'];
|
|
|
|
if (!is_file($path)) {
|
|
|
|
$this->response('指定图片已被系统删除!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$content = '';
|
|
|
|
$last_modified_time = gmdate(time() + ((30 * 60 * 60 * 24))) . " GMT";
|
|
|
|
$header = str_replace(['%Expires%', "%etag%", '%Last-Modified%'],
|
|
|
|
[$last_modified_time, $hash . ':' . $w . '_' . $h . '_' . 2, $last_modified_time], $this->upload_img['header']);
|
|
|
|
if ($w > 0 && $h > 0) {
|
|
|
|
$path = $this->cacheImage($info, $w, $h);
|
|
|
|
$content = file_get_contents($path);
|
|
|
|
$header['Content-Length'] = strlen($content);
|
|
|
|
} else {
|
|
|
|
$content = file_get_contents($path);
|
|
|
|
$header['Content-Length'] = $info['size'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$img_type = $info['type'];
|
|
|
|
$content = base64_encode($content);
|
...
|
...
|
|