Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
d79be4e2
Commit
d79be4e2
authored
Sep 27, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rollback
parent
c4ddbc72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
7 deletions
+0
-7
igirl-zcapi/app/base/api/impl/tool/imghandle.js
+0
-7
No files found.
igirl-zcapi/app/base/api/impl/tool/imghandle.js
View file @
d79be4e2
...
@@ -349,13 +349,11 @@ class ImageHandleApi extends ApiBase{
...
@@ -349,13 +349,11 @@ class ImageHandleApi extends ApiBase{
// var result=await this.ossClient.downfile(jpgpath);
// var result=await this.ossClient.downfile(jpgpath);
var
downClient
=
system
.
getObject
(
"util.restClient"
);
var
downClient
=
system
.
getObject
(
"util.restClient"
);
var
result
=
await
downClient
.
execDownload
(
jpgpath
,
destfile
);
var
result
=
await
downClient
.
execDownload
(
jpgpath
,
destfile
);
console
.
log
(
result
,
'111111111111111111111'
)
var
jpgpathtmp
=
"/tmp/"
+
basename
;
var
jpgpathtmp
=
"/tmp/"
+
basename
;
var
bkimgpath
=
"/tmp/bk"
+
basename
+
".jpg"
;
var
bkimgpath
=
"/tmp/bk"
+
basename
+
".jpg"
;
var
comimgpath
=
"/tmp/comimg"
+
basename
+
".jpg"
;
var
comimgpath
=
"/tmp/comimg"
+
basename
+
".jpg"
;
var
size
=
await
this
.
_getImgSize
(
jpgpathtmp
);
var
size
=
await
this
.
_getImgSize
(
jpgpathtmp
);
console
.
log
(
size
,
'22222222222222222'
)
var
maxSize
=
Math
.
max
(
size
.
height
,
size
.
width
);
var
maxSize
=
Math
.
max
(
size
.
height
,
size
.
width
);
var
scale
=
0
;
//不缩放
var
scale
=
0
;
//不缩放
if
(
maxSize
<
400
){
if
(
maxSize
<
400
){
...
@@ -368,22 +366,17 @@ class ImageHandleApi extends ApiBase{
...
@@ -368,22 +366,17 @@ class ImageHandleApi extends ApiBase{
}
}
//生成背景图片
//生成背景图片
var
bkimg
=
await
this
.
_onMakeTmBkPic
(
maxSize
,
bkimgpath
);
var
bkimg
=
await
this
.
_onMakeTmBkPic
(
maxSize
,
bkimgpath
);
console
.
log
(
bkimg
,
'3333333333333333333333333333'
)
//合成图像
//合成图像
var
comimg
=
await
this
.
_composeImg
(
scale
,
maxSize
,
jpgpathtmp
,
bkimgpath
,
comimgpath
);
var
comimg
=
await
this
.
_composeImg
(
scale
,
maxSize
,
jpgpathtmp
,
bkimgpath
,
comimgpath
);
console
.
log
(
comimg
,
'4444444444444444444444444'
)
//上传覆盖元先的路径
//上传覆盖元先的路径
var
rtn
=
await
this
.
ossClient
.
upfile
(
colorjpgpath
,
comimgpath
);
var
rtn
=
await
this
.
ossClient
.
upfile
(
colorjpgpath
,
comimgpath
);
console
.
log
(
rtn
,
'555555555555555555555555555'
)
fs
.
unlink
(
jpgpathtmp
,
function
(
err
){});
fs
.
unlink
(
jpgpathtmp
,
function
(
err
){});
fs
.
unlink
(
bkimgpath
,
function
(
err
){});
fs
.
unlink
(
bkimgpath
,
function
(
err
){});
// fs.unlink(comimgpath,function(err){});
// fs.unlink(comimgpath,function(err){});
var
grayimg
=
await
this
.
_grayImg
(
comimgpath
);
var
grayimg
=
await
this
.
_grayImg
(
comimgpath
);
console
.
log
(
grayimg
,
'666666666666666666666666'
)
var
blackjpgpath
=
await
this
.
getUidStr
(
20
,
62
)
+
".jpg"
;
var
blackjpgpath
=
await
this
.
getUidStr
(
20
,
62
)
+
".jpg"
;
blackjpgpath
=
"zc_black"
+
blackjpgpath
;
blackjpgpath
=
"zc_black"
+
blackjpgpath
;
var
rtn2
=
await
this
.
ossClient
.
upfile
(
blackjpgpath
,
comimgpath
);
var
rtn2
=
await
this
.
ossClient
.
upfile
(
blackjpgpath
,
comimgpath
);
console
.
log
(
rtn2
,
'77777777777777777777777777'
)
fs
.
unlink
(
comimgpath
,
function
(
err
){});
fs
.
unlink
(
comimgpath
,
function
(
err
){});
return
system
.
getResult2
({
"url"
:
rtn
.
url
,
"url2"
:
rtn2
.
url
},
null
);
return
system
.
getResult2
({
"url"
:
rtn
.
url
,
"url2"
:
rtn2
.
url
},
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