Commit c4ddbc72 by 任晓松

调试

parent 30ec4abc
......@@ -349,11 +349,13 @@ class ImageHandleApi extends ApiBase{
// var result=await this.ossClient.downfile(jpgpath);
var downClient=system.getObject("util.restClient");
var result=await downClient.execDownload(jpgpath,destfile);
console.log(result,'111111111111111111111')
var jpgpathtmp="/tmp/"+basename;
var bkimgpath="/tmp/bk"+basename+".jpg";
var comimgpath="/tmp/comimg"+basename+".jpg";
var size=await this._getImgSize(jpgpathtmp);
console.log(size,'22222222222222222')
var maxSize=Math.max(size.height,size.width);
var scale=0;//不缩放
if(maxSize<400){
......@@ -366,17 +368,22 @@ class ImageHandleApi extends ApiBase{
}
//生成背景图片
var bkimg=await this._onMakeTmBkPic(maxSize,bkimgpath);
console.log(bkimg,'3333333333333333333333333333')
//合成图像
var comimg=await this._composeImg(scale,maxSize,jpgpathtmp,bkimgpath,comimgpath);
console.log(comimg,'4444444444444444444444444')
//上传覆盖元先的路径
var rtn=await this.ossClient.upfile(colorjpgpath,comimgpath);
console.log(rtn,'555555555555555555555555555')
fs.unlink(jpgpathtmp,function(err){});
fs.unlink(bkimgpath,function(err){});
// fs.unlink(comimgpath,function(err){});
var grayimg=await this._grayImg(comimgpath);
console.log(grayimg,'666666666666666666666666')
var blackjpgpath = await this.getUidStr(20,62)+".jpg";
blackjpgpath = "zc_black"+blackjpgpath;
var rtn2=await this.ossClient.upfile(blackjpgpath,comimgpath);
console.log(rtn2,'77777777777777777777777777')
fs.unlink(comimgpath,function(err){});
return system.getResult2({"url":rtn.url,"url2":rtn2.url},null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment