Optimized some things, fixed ifunny not properly appending to image

This commit is contained in:
TheEssem 2020-03-02 17:10:29 -06:00
parent 6963c44e60
commit 0ff784089b
2 changed files with 6 additions and 6 deletions

View file

@ -8,7 +8,7 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to add a iFunny watermark!`;
const watermark = "./assets/images/ifunny.png";
const size = await gm(image.path).sizePromise();
const buffer = await gm(image.path).coalesce().out("null:").out(watermark).gravity("South").resize(size.width, null).out("-layers", "composite").bufferPromise(image.type);
const buffer = await gm(image.path).coalesce().extent(size.width, size.height + (42 * Math.min(size.width / 1024, size.height / 42))).out("null:").out(watermark).gravity("South").resize(size.width, null).out("-layers", "composite").bufferPromise(image.type);
return message.channel.createMessage("", {
file: buffer,
name: `ifunny.${image.type}`