Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
3706a920
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3706a920
编写于
10月 23, 2021
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
移除附件重新绘制功能
上级
eb9fd349
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
62 deletion
+1
-62
app/admin/view/default/site/attachment/index.html
app/admin/view/default/site/attachment/index.html
+0
-14
extend/base/Uploader.php
extend/base/Uploader.php
+1
-48
未找到文件。
app/admin/view/default/site/attachment/index.html
浏览文件 @
3706a920
...
@@ -36,20 +36,6 @@
...
@@ -36,20 +36,6 @@
</span>
</span>
</div>
</div>
</div>
</div>
<div
class=
"am-form-group"
>
<label>
{{$data.is_upload_images_redraw.name}}
<span
class=
"am-form-group-label-tips"
>
{{$data.is_upload_images_redraw.describe}}
</span></label>
<select
name=
"{{$data.is_upload_images_redraw.only_tag}}"
class=
"am-radius chosen-select"
data-validation-message=
"{{$data.is_upload_images_redraw.error_tips}}"
required
>
{{foreach $common_is_text_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
data
['
is_upload_images_redraw
']['
value
'])
and
$
data
['
is_upload_images_redraw
']['
value
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
1. 默认否、建议开启上传图片重新绘制、防止木马病毒图片上传
</p>
<p>
2. 开启后gif动态图片将失效、由于重新绘制图片大小也会改变
</p>
</div>
</div>
<div
class=
"am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0"
>
<div
class=
"am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0"
>
<input
type=
"hidden"
name=
"nav_type"
value=
"{{$nav_type}}"
/>
<input
type=
"hidden"
name=
"nav_type"
value=
"{{$nav_type}}"
/>
...
...
extend/base/Uploader.php
浏览文件 @
3706a920
...
@@ -237,55 +237,8 @@ class Uploader
...
@@ -237,55 +237,8 @@ class Uploader
return
;
return
;
}
}
// 如未安装相应的gd库则直接存储文件
// 未开启重新绘制
$is_move
=
false
;
// 是否开启图片重新绘制
if
(
MyC
(
'is_upload_images_redraw'
,
0
)
==
1
)
{
switch
(
$this
->
fileType
)
{
case
'.png'
:
if
(
function_exists
(
'imagecreatefrompng'
))
{
$image
=
imagecreatefrompng
(
$file
[
"tmp_name"
]);
//PNG
imagesavealpha
(
$image
,
true
);
//这里很重要 意思是不要丢了$sourePic图像的透明色;
$width
=
imagesx
(
$image
);
//图宽度
$heigh
=
imagesy
(
$image
);
//图高度
$thumb
=
imagecreatetruecolor
(
$width
,
$heigh
);
imagealphablending
(
$thumb
,
false
);
//这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色;
imagesavealpha
(
$thumb
,
true
);
//这里很重要,意思是不要丢了$thumb图像的透明色;
if
(
imagecopyresampled
(
$thumb
,
$image
,
0
,
0
,
0
,
0
,
$width
,
$heigh
,
$width
,
$heigh
))
{
imagepng
(
$thumb
,
$this
->
filePath
);
}
}
else
{
$is_move
=
true
;
}
break
;
case
'.gif'
:
if
(
function_exists
(
'imagecreatefromgif'
))
{
@
imagegif
(
@
imagecreatefromgif
(
$file
[
"tmp_name"
]),
$this
->
filePath
);
}
else
{
$is_move
=
true
;
}
break
;
default
:
if
(
function_exists
(
'imagecreatefromjpeg'
))
{
@
imagejpeg
(
@
imagecreatefromjpeg
(
$file
[
"tmp_name"
]),
$this
->
filePath
,
100
);
}
else
{
$is_move
=
true
;
}
}
}
else
{
$is_move
=
true
;
}
// 是否需要直接存储文件
// 是否需要直接存储文件
if
(
$is_move
&&
!
move_uploaded_file
(
$file
[
"tmp_name"
],
$this
->
filePath
))
if
(
!
move_uploaded_file
(
$file
[
"tmp_name"
],
$this
->
filePath
))
{
{
$this
->
stateInfo
=
$this
->
getStateInfo
(
"ERROR_FILE_MOVE"
);
$this
->
stateInfo
=
$this
->
getStateInfo
(
"ERROR_FILE_MOVE"
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录