|
|
@ -7,6 +7,22 @@ export default async function handler(req, res) {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const image = await Jimp.read(baseURL + img)
|
|
|
|
const image = await Jimp.read(baseURL + img)
|
|
|
|
|
|
|
|
const crest = image.clone().crop(3,5,60,96)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const level = parseInt(
|
|
|
|
|
|
|
|
img.substring(
|
|
|
|
|
|
|
|
img.indexOf("-") + 1,
|
|
|
|
|
|
|
|
img.lastIndexOf(".")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (level % 8 > 0) {
|
|
|
|
|
|
|
|
image
|
|
|
|
|
|
|
|
.composite(crest, 10, 173, {
|
|
|
|
|
|
|
|
mode: Jimp.BLEND_SOURCE_OVER,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
image
|
|
|
|
image
|
|
|
|
.crop(4,168,412,190)
|
|
|
|
.crop(4,168,412,190)
|
|
|
|
.resize(316,143)
|
|
|
|
.resize(316,143)
|
|
|
|