From 75051d03c31b27a12aec1cdf2190d5fd7f2d3e0c Mon Sep 17 00:00:00 2001 From: TheEssem Date: Fri, 3 Apr 2020 09:23:26 -0500 Subject: [PATCH] Added some spacing to caption --- commands/caption.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/caption.js b/commands/caption.js index 8c30515..fb7fc8a 100644 --- a/commands/caption.js +++ b/commands/caption.js @@ -9,7 +9,7 @@ exports.run = async (message, args) => { if (args.length === 0) return `${message.author.mention}, you need to provide some text to add a caption!`; const processMessage = await message.channel.createMessage(" Processing... This might take a while"); const size = await gm(image.path).sizePromise(); - const output = await gm().out("-size", `${size.width}x`).background("white").fill("black").font("./assets/caption.otf", size.width / 10).gravity("Center").out(`caption:${args.join(" ")}`).bufferPromise("png"); + const output = await gm().out("-size", `${size.width - ((size.width / 25) * 2)}x`).background("white").fill("black").font("./assets/caption.otf", size.width / 10).gravity("Center").out(`caption:${args.join(" ")}`).extent(size.width, `%[fx:h+${size.width / 25}]`).bufferPromise("png"); const size2 = await gm(output).sizePromise(); //const output2 = await gm(output).gravity("Center").trim().out("+repage").extent(size.width, size2.height + (size.width / 10)).streamPromise(); const outputFinal = await gm(output).in("(").gravity("Center").trim().out("+repage").extent(size.width, size2.height + (size.width / 10)).out(")").background("white").out("-alpha", "set").out("(").out(image.path).out("-coalesce").out(")").colorspace("sRGB").out("-set", "page", "%[fx:u.w]x%[fx:u.h+v.h]+%[fx:t?(u.w-v.w)/2:0]+%[fx:t?u.h:0]").out("-coalesce").out("null:").out("-insert", 1).out("-layers", "composite").bufferPromise(image.type, image.delay);