优化部分图像生成的格式及尺寸,获得速度与质量的平衡

This commit is contained in:
yoimiya-kokomi 2022-04-28 02:49:24 +08:00
parent 3ecde0ef77
commit 7c7e3d6033
5 changed files with 11 additions and 11 deletions

View File

@ -94,8 +94,8 @@ export async function sysCfg(e, { render }) {
let base64 = await render("admin", "index", {
...cfg,
cfgScale: Cfg.scale(1.2)
}, "png");
cfgScale: Cfg.scale(1.4)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}

View File

@ -345,8 +345,8 @@ async function renderCard(e, avatar, render, renderType = "card") {
bg,
...getCharacterData(avatar),
ds: char.getData("name,id,title,desc"),
cfgScale: Cfg.scale(1.25)
}, "png");
cfgScale: Cfg.scale(1.6)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}

View File

@ -41,8 +41,8 @@ export async function help(e, { render }) {
let base64 = await render("help", "index", {
helpCfg: helpGroup,
cfgScale: Cfg.scale(1.05)
}, "png");
cfgScale: Cfg.scale(1.2)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}

View File

@ -78,8 +78,8 @@ export async function consStat(e, { render }) {
pct: function (num) {
return (num * 100).toFixed(2);
},
cfgScale: Cfg.scale(1.4)
}, "png");
cfgScale: Cfg.scale(1.5)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}
@ -156,8 +156,8 @@ export async function abyssPct(e, { render }) {
pct: function (num) {
return (num * 100).toFixed(2);
},
cfgScale: Cfg.scale(1.4)
}, "png");
cfgScale: Cfg.scale(1.5)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}

View File

@ -393,7 +393,7 @@ let Calc = {
avg: atkNum * pctNum * (1 + multiNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
}
console.log(attr, { atkNum, pctNum, multiNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret)
// console.log(attr, { atkNum, pctNum, multiNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret)
return ret;
};