Fixed two generation

This commit is contained in:
Killian
2020-10-19 13:45:03 +02:00
parent 8be8d9a61d
commit d37c3bcffe
5 changed files with 12 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 579 KiB

View File

@@ -1,5 +1,4 @@
const Canvas = require("canvas");
const jimp = require("jimp");
module.exports = class Rip {
/**
@@ -9,12 +8,12 @@ module.exports = class Rip {
async getImage(image) {
if (!image) throw new Error(`You must provide an image.`);
const canvas = Canvas.createCanvas(244, 253);
const canvas = Canvas.createCanvas(720, 405);
const ctx = canvas.getContext(`2d`);
const background = await Canvas.loadImage(`${__dirname}/../../assets/rip.png`);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
const avatar = await Canvas.loadImage(image);
ctx.drawImage(avatar, 63, 110, 90, 90);
ctx.drawImage(avatar, 110, 47, 85, 85);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
return canvas.toBuffer();
}
}

View File

@@ -14,6 +14,8 @@ module.exports = class Spank {
image2 = await jimp.read(image2);
image1.circle();
image2.circle();
image1.greyscale();
image2.greyscale();
bg.resize(500, 500);
image1.resize(140, 140);
image2.resize(120, 120);