You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-16 11:53:58 +08:00
v2.5.5
This commit is contained in:
@@ -319,7 +319,7 @@ class timthumb
|
||||
|
||||
$cachePrefix = ($this->isURL ? '_ext_' : '_int_');
|
||||
if ($this->isURL) {
|
||||
$arr = explode('&', $_SERVER ['QUERY_STRING']);
|
||||
$arr = explode('&', $_SERVER['QUERY_STRING']);
|
||||
asort($arr);
|
||||
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
||||
} else {
|
||||
@@ -333,7 +333,7 @@ class timthumb
|
||||
$this->debug(1, "Local image path is {$this->localImage}");
|
||||
$this->localImageMTime = @filemtime($this->localImage);
|
||||
//We include the mtime of the local file in case in changes on disk.
|
||||
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
||||
$this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
|
||||
}
|
||||
$this->debug(2, "Cache file is: " . $this->cachefile);
|
||||
|
||||
@@ -580,7 +580,7 @@ class timthumb
|
||||
$mimeType = $sData['mime'];
|
||||
|
||||
$this->debug(3, "Mime type of image is $mimeType");
|
||||
if (!preg_match('/^image\/(?:gif|jpg|jpeg|png|webp)$/i', $mimeType)) {
|
||||
if (!preg_match('/^image\/(?:gif|jpg|jpeg|png|webp|bmp)$/i', $mimeType)) {
|
||||
return $this->error("The image being resized is not a valid gif, jpg or png.");
|
||||
}
|
||||
|
||||
@@ -828,8 +828,11 @@ class timthumb
|
||||
$imgType = 'gif';
|
||||
imagegif($canvas, $tempfile);
|
||||
} else if (preg_match('/^image\/webp$/i', $mimeType)) {
|
||||
$imgType = 'WEBP';
|
||||
$imgType = 'webp';
|
||||
imagewebp($canvas, $tempfile);
|
||||
} else if (preg_match('/^image\/bmp$/i', $mimeType)) {
|
||||
$imgType = 'bmp';
|
||||
imagebmp($canvas, $tempfile);
|
||||
} else {
|
||||
return $this->sanityFail("Could not match mime type after verifying it previously.");
|
||||
}
|
||||
@@ -876,9 +879,9 @@ class timthumb
|
||||
$tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
|
||||
$context = stream_context_create();
|
||||
$fp = fopen($tempfile, 'r', 0, $context);
|
||||
if(strlen($imgType) == 3) {
|
||||
if (strlen($imgType) == 3) {
|
||||
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 3 being image type
|
||||
}elseif (strlen($imgType) == 4){
|
||||
} elseif (strlen($imgType) == 4) {
|
||||
file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //7 extra bytes, first 4 being image type
|
||||
}
|
||||
file_put_contents($tempfile4, $fp, FILE_APPEND);
|
||||
@@ -1096,7 +1099,7 @@ class timthumb
|
||||
}
|
||||
|
||||
$mimeType = $this->getMimeType($tempfile);
|
||||
if (!preg_match("/^image\/(?:jpg|jpeg|gif|png|webp)$/i", $mimeType)) {
|
||||
if (!preg_match("/^image\/(?:jpg|jpeg|gif|png|webp|bmp)$/i", $mimeType)) {
|
||||
$this->debug(3, "Remote file has invalid mime type: $mimeType");
|
||||
@unlink($this->cachefile);
|
||||
touch($this->cachefile);
|
||||
@@ -1171,6 +1174,9 @@ class timthumb
|
||||
if (strtolower($mimeType) == 'image/webp') {
|
||||
$mimeType = 'image/webp';
|
||||
}
|
||||
if (strtolower($mimeType) == 'image/bmp') {
|
||||
$mimeType = 'image/bmp';
|
||||
}
|
||||
$gmdate_expires = gmdate('D, d M Y H:i:s', strtotime('now +10 days')) . ' GMT';
|
||||
$gmdate_modified = gmdate('D, d M Y H:i:s') . ' GMT';
|
||||
// send content headers then display image
|
||||
@@ -1193,7 +1199,6 @@ class timthumb
|
||||
|
||||
protected function securityChecks()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected function param($property, $default = '')
|
||||
@@ -1215,6 +1220,10 @@ class timthumb
|
||||
case 'image/webp':
|
||||
$image = imagecreatefromwebp($src);
|
||||
break;
|
||||
|
||||
case 'image/bmp':
|
||||
$image = imagecreatefrombmp($src);
|
||||
break;
|
||||
|
||||
case 'image/png':
|
||||
$image = imagecreatefrompng($src);
|
||||
@@ -1412,5 +1421,4 @@ class timthumb
|
||||
{
|
||||
return $this->is404;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ function write_chart_total()
|
||||
$count_contents['chart_disk'][] = [$count_day[$i] => getDirectorySize($total_contents . $count_day[$i])];
|
||||
}
|
||||
|
||||
if(!is_dir(APP_ROOT.'/admin/logs/counts/')){
|
||||
mkdir(APP_ROOT.'/admin/logs/counts/',0755,true);
|
||||
if (!is_dir(APP_ROOT . '/admin/logs/counts/')) {
|
||||
mkdir(APP_ROOT . '/admin/logs/counts/', 0755, true);
|
||||
}
|
||||
|
||||
$count_contents = json_encode($count_contents, true);
|
||||
|
||||
@@ -43,9 +43,6 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
||||
<script src="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/qrcode/qrcode.min.js"></script>
|
||||
<script>
|
||||
// NProgress
|
||||
NProgress.start();
|
||||
NProgress.done();
|
||||
// 导航状态
|
||||
$('.nav-pills').find('a').each(function() {
|
||||
if (this.href == document.location.href) {
|
||||
@@ -53,6 +50,10 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
|
||||
}
|
||||
});
|
||||
|
||||
// NProgress
|
||||
NProgress.start();
|
||||
NProgress.done();
|
||||
|
||||
// js 获取当前网址二维码
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
text: window.location.href,
|
||||
|
||||
@@ -1078,3 +1078,78 @@ function IP_URL_Ping($host, $port, $timeout)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Token
|
||||
* @param int $length Token长度
|
||||
* @return string 返回Token
|
||||
*/
|
||||
function privateToken($length = 32)
|
||||
{
|
||||
$output = '';
|
||||
for ($a = 0; $a < $length; $a++) {
|
||||
$output .= chr(mt_rand(65, 122)); //生成php随机数
|
||||
}
|
||||
return md5($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查Token
|
||||
* @param $token 要检查的Token
|
||||
* code:201 访问成功但是服务端关闭API上传
|
||||
* code:202 访问成功但是Token错误
|
||||
*/
|
||||
function check_api($token)
|
||||
{
|
||||
global $config;
|
||||
global $tokenList;
|
||||
|
||||
if (!$config['apiStatus']) {
|
||||
// API关闭 服务端关闭API上传
|
||||
$reJson = array(
|
||||
"result" => 'failed',
|
||||
'code' => 201,
|
||||
'message' => 'API Closed',
|
||||
);
|
||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
if (!in_array($tokenList[$token], $tokenList)) {
|
||||
// Token 是否存在
|
||||
$reJson = array(
|
||||
"result" => 'failed',
|
||||
'code' => 202,
|
||||
'message' => 'Token Error',
|
||||
);
|
||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
if ($tokenList[$token]['expired'] < time()) {
|
||||
// Token 是否过期
|
||||
$reJson = array(
|
||||
"result" => 'failed',
|
||||
'code' => 203,
|
||||
'message' => 'Token Expired',
|
||||
);
|
||||
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断webp是否为动态图片
|
||||
* @param $src 图像文件
|
||||
* @return bool 是|否
|
||||
*/
|
||||
function isWebpAnimated($src)
|
||||
{
|
||||
$webpContents = file_get_contents($src);
|
||||
$where = strpos($webpContents, "ANMF");
|
||||
if ($where !== FALSE) {
|
||||
// animated
|
||||
$isAnimated = true;
|
||||
} else {
|
||||
// non animated
|
||||
$isAnimated = false;
|
||||
}
|
||||
return $isAnimated;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php require_once __DIR__ . '/header.php'; ?>
|
||||
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.css">
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css">
|
||||
<style>
|
||||
/** 图片列表*/
|
||||
|
||||
@@ -97,26 +95,27 @@
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
</style>
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
if (!$config['showSwitch'] && !is_who_login('admin')) {
|
||||
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
||||
} else {
|
||||
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/'); // 获取指定目录
|
||||
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
|
||||
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber']; // 获取指定浏览数量
|
||||
$keyNum = preg_replace("/[\W]/", "", trim($keyNum)); // 过滤非数字,删除空格
|
||||
// $fileArr = getFile(APP_ROOT . config_path($path)); // 获取当日上传列表
|
||||
$fileType = isset($_GET['search']) ? '*.' . preg_replace("/[\W]/", "", $_GET['search']) : '*.*'; // 按照图片格式
|
||||
$fileArr = get_file_by_glob(APP_ROOT . config_path($path) . $fileType, 'list'); // 获取当日上传列表
|
||||
echo '
|
||||
<div class="row" style="margin-bottom:100px">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
if (!$config['showSwitch'] && !is_who_login('admin')) {
|
||||
echo '<div class="alert alert-info">管理员关闭了预览哦~~</div>';
|
||||
} else {
|
||||
$path = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/'); // 获取指定目录
|
||||
$path = preg_replace("/^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$/s", "", trim($path)); // 过滤非日期,删除空格
|
||||
$keyNum = isset($_GET['num']) ? $_GET['num'] : $config['listNumber']; // 获取指定浏览数量
|
||||
$keyNum = preg_replace("/[\W]/", "", trim($keyNum)); // 过滤非数字,删除空格
|
||||
// $fileArr = getFile(APP_ROOT . config_path($path)); // 获取当日上传列表
|
||||
$fileType = isset($_GET['search']) ? '*.' . preg_replace("/[\W]/", "", $_GET['search']) : '*.*'; // 按照图片格式
|
||||
$fileArr = get_file_by_glob(APP_ROOT . config_path($path) . $fileType, 'list'); // 获取当日上传列表
|
||||
echo '
|
||||
<ul id="viewjs">
|
||||
<div class="cards listNum">';
|
||||
if ($fileArr[0]) {
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
||||
echo '
|
||||
if ($fileArr[0]) {
|
||||
foreach ($fileArr as $key => $value) {
|
||||
if ($key < $keyNum) {
|
||||
$imgUrl = $config['imgurl'] . config_path($path) . $value;
|
||||
echo '
|
||||
<div class="col-md-4 col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<li><img src="../public/images/loading.svg" data-image="' . creat_thumbnail_by_list($imgUrl) . '" data-original="' . $imgUrl . '" alt="简单图床-EasyImage"></li>
|
||||
@@ -130,48 +129,48 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger">今天还没有上传的图片哟~~ <br />快来上传第一张吧~!</div>';
|
||||
echo '</ul>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
// 当前日期全部上传
|
||||
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
||||
$allUploud = get_file_by_glob(APP_ROOT . $config['path'] . $allUploud, 'number');
|
||||
// 组合url
|
||||
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
<div class="col-md-8 col-xs-12" style="padding-bottom:5px">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-danger btn-mini" href="?<?php echo http_build_query($httpUrl); ?>">当前<?php echo $allUploud; ?></a>
|
||||
<a class="btn btn-primary btn-mini" href="list.php">今日<?php echo get_file_by_glob(APP_ROOT . config_path() . '*.*', 'number'); ?></a>
|
||||
<a class="btn btn-mini" href="?date=<?php echo date("Y/m/d/", strtotime("-1 day")) ?>">昨日<?php echo get_file_by_glob(APP_ROOT . $config['path'] . date("Y/m/d/", strtotime("-1 day")), 'number'); ?></a>
|
||||
<?php
|
||||
// 倒推日期显示上传图片
|
||||
for ($x = 2; $x <= 6; $x++)
|
||||
echo '<a class="btn btn-mini hidden-xs inline-block" href="?date=' . date('Y/m/d/', strtotime("-$x day")) . '">' . date('m月d日', strtotime("-$x day")) . '</a>';
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'checkall')">全选</a>
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'reversecheck')">反选</a>
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'uncheckall')">取消</a>
|
||||
<a class="btn btn-mini" onclick="recycle_img()">回收</a>
|
||||
<a class="btn btn-mini" onclick="delete_img()">删除</a>
|
||||
// 当前日期全部上传
|
||||
$allUploud = isset($_GET['date']) ? $_GET['date'] : date('Y/m/d/');
|
||||
$allUploud = get_file_by_glob(APP_ROOT . $config['path'] . $allUploud, 'number');
|
||||
// 组合url
|
||||
@$httpUrl = array('date' => $path, 'num' => getFileNumber(APP_ROOT . config_path($path)));
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
<div class="col-md-8 col-xs-12" style="padding-bottom:5px">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-danger btn-mini" href="?<?php echo http_build_query($httpUrl); ?>">当前<?php echo $allUploud; ?></a>
|
||||
<a class="btn btn-primary btn-mini" href="list.php">今日<?php echo get_file_by_glob(APP_ROOT . config_path() . '*.*', 'number'); ?></a>
|
||||
<a class="btn btn-mini" href="?date=<?php echo date("Y/m/d/", strtotime("-1 day")) ?>">昨日<?php echo get_file_by_glob(APP_ROOT . $config['path'] . date("Y/m/d/", strtotime("-1 day")), 'number'); ?></a>
|
||||
<?php
|
||||
// 倒推日期显示上传图片
|
||||
for ($x = 2; $x <= 6; $x++)
|
||||
echo '<a class="btn btn-mini hidden-xs inline-block" href="?date=' . date('Y/m/d/', strtotime("-$x day")) . '">' . date('m月d日', strtotime("-$x day")) . '</a>';
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'checkall')">全选</a>
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'reversecheck')">反选</a>
|
||||
<a class="btn btn-mini" onclick="opcheckboxed('checkbox', 'uncheckall')">取消</a>
|
||||
<a class="btn btn-mini" onclick="recycle_img()">回收</a>
|
||||
<a class="btn btn-mini" onclick="delete_img()">删除</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按格式 -->
|
||||
<div class="row">
|
||||
<!--
|
||||
<!-- 按格式 -->
|
||||
<div class="row">
|
||||
<!--
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<form action="list.php" method="get">
|
||||
<div class="input-group">
|
||||
@@ -186,33 +185,36 @@
|
||||
</div>
|
||||
</form>
|
||||
</div> -->
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=jpg'; ?>">JPG</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=png'; ?>">PNG</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=gif'; ?>">GIF</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=webp'; ?>">Webp</a>
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=jpg'; ?>">JPG</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=png'; ?>">PNG</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=gif'; ?>">GIF</a>
|
||||
<a class="btn btn-sm" href="<?php echo '?' . http_build_query($httpUrl) . '&search=webp'; ?>">Webp</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按日期-->
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon fix-border fix-padding"></span>
|
||||
<input type="text" class="form-control form-date input-sm" name="date" value="<?php echo date('Y/m/d/'); ?>" readonly="readonly">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-primary input-sm">按日期</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按日期-->
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon fix-border fix-padding"></span>
|
||||
<input type="text" class="form-control form-date input-sm" name="date" value="<?php echo date('Y/m/d/'); ?>" readonly="readonly">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-primary input-sm">按日期</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 返回顶部 -->
|
||||
<div style="display: none;" id="rocket-to-top">
|
||||
<div style="opacity:0;display: block;" class="level-2"></div>
|
||||
<div class="level-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 返回顶部 -->
|
||||
<div style="display: none;" id="rocket-to-top">
|
||||
<div style="opacity:0;display: block;" class="level-2"></div>
|
||||
<div class="level-3"></div>
|
||||
</div>
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.css">
|
||||
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css">
|
||||
<script src="<?php static_cdn(); ?>/public/static/lazyload/lazyload.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
@@ -293,7 +295,7 @@
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
// 删除图片
|
||||
// 删除图片
|
||||
function delete_img() {
|
||||
var r = confirm("确认要删除?\n* 删除文件夹后将无法恢复!")
|
||||
if (r == true) {
|
||||
|
||||
@@ -83,5 +83,25 @@ $ALLOWED_SITES = array(
|
||||
'mindsharestudios.com'
|
||||
);
|
||||
|
||||
require_once __DIR__ . '/TimThumb.php';
|
||||
timthumb::start();
|
||||
/**
|
||||
* 修复无法生成生成webp动态图片的缩略图bug
|
||||
*/
|
||||
if (isset($_GET['img'])) {
|
||||
// 获取图片后缀后4位
|
||||
$ext = substr($_GET['img'], -4);
|
||||
// 图片绝对路径
|
||||
$src = APP_ROOT . $_GET['img'];
|
||||
// 检测图片
|
||||
if ($ext == 'webp' && isWebpAnimated($src)) {
|
||||
// 输出动态的webp
|
||||
header("Content-type: image/webp");
|
||||
exit(file_get_contents($src, true));
|
||||
}
|
||||
// 非动态webp输出
|
||||
require_once __DIR__ . '/TimThumb.php';
|
||||
timthumb::start();
|
||||
} else {
|
||||
// 输出404
|
||||
header("Content-type: image/webp");
|
||||
exit(file_get_contents(APP_ROOT . '/public/images/404.png', true));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user