You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
v2.6.8
- 上传组件支持到 PHP 8.2 - 修复下载任意文件漏洞 [#75](https://github.com/icret/EasyImages2.0/issues/75) - 增加自定义底部信息 - 增加自定义管理提示 - 增加图床模式 - 危险:除图片外不验证文件是否正常,也代表可以上传任意指定格式! - 增加上传时生成缩略图(仅设置直链缩略图时生效),低配vps负载较大,影响前端上传速度! - 其他一些优化
This commit is contained in:
@@ -94,7 +94,7 @@ if ($handle->uploaded) {
|
||||
// 图片完整相对路径:/i/2021/05/03/k88e7p.jpg
|
||||
if ($handle->processed) {
|
||||
header('Content-type:text/json');
|
||||
// 上传成功后返回json数据
|
||||
|
||||
// 图片相对路径
|
||||
$pathIMG = $Img_path . $handle->file_dst_name;
|
||||
// 图片访问网址
|
||||
@@ -132,6 +132,28 @@ if ($handle->uploaded) {
|
||||
$delUrl = "Admin closed delete";
|
||||
}
|
||||
|
||||
// 当设置访问生成缩略图时自动生成 2022-12-30
|
||||
if($config['thumbnail'] == 2) {
|
||||
// 自定义缩略图长宽
|
||||
$thumbnail_w = 258;
|
||||
$thumbnail_h = 258;
|
||||
|
||||
$handle->image_resize = true;
|
||||
|
||||
if (!empty($config['thumbnail_w']) || !empty($config['thumbnail_h'])) {
|
||||
$handle->image_x = $config['thumbnail_w'];
|
||||
$handle->image_y = $config['thumbnail_h'];
|
||||
}
|
||||
// 如果调整后的图像大于原始图像,则取消调整大小,以防止放大
|
||||
$handle->image_no_enlarging = true;
|
||||
|
||||
$handle->file_new_name_body = date('Y_m_d_') . $handle->file_dst_name_body;
|
||||
|
||||
$handle->process(APP_ROOT . $config['path']. 'thumbnails/');
|
||||
|
||||
}
|
||||
|
||||
// 上传成功后返回json数据
|
||||
$reJson = array(
|
||||
"result" => "success",
|
||||
"code" => 200,
|
||||
|
||||
Reference in New Issue
Block a user