Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
徐少华
midjourney-proxy
Commits
dc42eb71
Commit
dc42eb71
authored
Jun 03, 2019
by
songxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释没用的代码
parent
b975c2a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
ImageUtils.java
...mon/src/main/java/com/pcloud/common/utils/ImageUtils.java
+22
-22
No files found.
pcloud-common/src/main/java/com/pcloud/common/utils/ImageUtils.java
View file @
dc42eb71
...
...
@@ -815,28 +815,28 @@ public class ImageUtils {
* 源文件上传后的路径,主要用于子文件上传时对应http文件路径
*/
public
static
UploadResultInfo
toWebp
(
String
fileUrl
)
{
String
fileNameAll
=
FileUtils
.
getFileNameAll
(
fileUrl
);
String
localFilePath
=
FilePathConst
.
DOWNLOAD_PATH
+
fileNameAll
;
FileUtils
.
downloadFileFromUrl
(
fileUrl
,
localFilePath
);
String
tragetPath
=
null
;
try
{
tragetPath
=
com
.
dcg
.
util
.
ImageUtils
.
transcodeToWebp
(
localFilePath
,
80
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【IMAGE】图片转换成webp失败:"
+
e
.
getMessage
(),
e
);
return
null
;
}
if
(
StringUtils
.
isEmpty
(
tragetPath
))
{
return
null
;
}
try
{
return
OssUtils
.
uploadLocalFile4Child
(
tragetPath
,
fileUrl
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【IMAGE】图片转换成webp,上传失败:"
+
e
.
getMessage
(),
e
);
}
finally
{
FileUtils
.
deleteFile
(
localFilePath
);
FileUtils
.
deleteFile
(
tragetPath
);
}
return
null
;
//
String fileNameAll = FileUtils.getFileNameAll(fileUrl);
//
String localFilePath = FilePathConst.DOWNLOAD_PATH + fileNameAll;
//
FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
//
String tragetPath = null;
//
try {
//
tragetPath = com.dcg.util.ImageUtils.transcodeToWebp(localFilePath, 80);
//
} catch (Exception e) {
//
LOGGER.error("【IMAGE】图片转换成webp失败:" + e.getMessage(), e);
//
return null;
//
}
//
if (StringUtils.isEmpty(tragetPath)) {
//
return null;
//
}
//
try {
//
return OssUtils.uploadLocalFile4Child(tragetPath, fileUrl);
//
} catch (Exception e) {
//
LOGGER.error("【IMAGE】图片转换成webp,上传失败:" + e.getMessage(), e);
//
} finally {
//
FileUtils.deleteFile(localFilePath);
//
FileUtils.deleteFile(tragetPath);
//
}
//
return null;
}
}
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