Fixed sizing for caption
This commit is contained in:
parent
b4c8d243a8
commit
c28c575b48
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ exports.run = async (message, args) => {
|
||||||
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
|
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
|
||||||
const output = await gm(image.path).out("-size", "%[fx:w]x").background("white").fill("black").font("./assets/caption.otf", "%[fx:w/10]").out("-delete", "0--1").gravity("Center").out(`caption:${args.join(" ")}`).bufferPromise("png");
|
const output = await gm(image.path).out("-size", "%[fx:w]x").background("white").fill("black").font("./assets/caption.otf", "%[fx:w/10]").out("-delete", "0--1").gravity("Center").out(`caption:${args.join(" ")}`).bufferPromise("png");
|
||||||
const output2 = await gm(output).out(image.path).gravity("Center").trim().out("+repage").extent("%[fx:v.w]", "%[fx:u.h + ( v.w/10 )]").out("-delete", "1--1").streamPromise();
|
const output2 = await gm(output).out(image.path).gravity("Center").trim().out("+repage").extent("%[fx:v.w]", "%[fx:u.h + ( v.w/10 )]").out("-delete", "1--1").streamPromise();
|
||||||
const outputFinal = await gm(output2).out("-alpha", "set").background("none").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);
|
const outputFinal = await gm(output2).out("-alpha", "set").background("none").out("(").out(image.path).out("-coalesce").out(")").colorspace("sRGB").out("-set", "page", "%[fx:v.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);
|
||||||
await processMessage.delete();
|
await processMessage.delete();
|
||||||
//return upload(message, outputFinal, `caption.${image.type}`);
|
//return upload(message, outputFinal, `caption.${image.type}`);
|
||||||
return message.channel.createMessage("", {
|
return message.channel.createMessage("", {
|
||||||
|
|
Loading…
Reference in a new issue