Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-rpc
Commits
fd25633d
Commit
fd25633d
authored
Nov 26, 2020
by
fuyunnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交裁剪图片重复下载图片的问题
parent
d5979ef7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
Drawer.php
src/Tools/Drawer.php
+16
-2
No files found.
src/Tools/Drawer.php
View file @
fd25633d
...
...
@@ -176,9 +176,23 @@ class Drawer
if
(
$imgInfo
&&
end
(
$imgInfo
)
==
"image/webp"
)
{
$filename
=
trim
(
pathinfo
(
$filePath
,
PATHINFO_FILENAME
));
$im
=
imagecreatefromwebp
(
$filePath
);
// 加载 WebP 文件
imagejpeg
(
$im
,
$savePath
.
$filename
.
'.jpeg'
,
100
);
// 以 100% 的质量转换成 jpeg 格式
switch
(
$ext
){
case
'jpg'
:
$toNewFileName
=
$savePath
.
$filename
.
'.jpg'
;
break
;
case
'png'
:
$toNewFileName
=
$savePath
.
$filename
.
'.png'
;
break
;
case
'jpeg'
:
$toNewFileName
=
$savePath
.
$filename
.
'.jpeg'
;
break
;
default
:
$toNewFileName
=
$savePath
.
$filename
.
'.jpeg'
;
break
;
}
imagejpeg
(
$im
,
$toNewFileName
,
30
);
//转化图片比例
imagedestroy
(
$im
);
return
$
savePath
.
$filename
.
'.jpeg'
;
return
$
toNewFileName
;
}
return
$savePath
.
"
$filename
.
$ext
"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment