One of the commits from a few days ago was a mistake

This commit is contained in:
TheEssem 2020-02-19 08:25:45 -06:00
parent 777b86e480
commit e2a32a8c89
36 changed files with 70 additions and 37 deletions

View File

@ -1,4 +1,3 @@
const fs = require("fs");
const gm = require("gm").subClass({
imageMagick: true
});
@ -10,8 +9,9 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to add a 9GAG watermark!`;
const watermark = "./assets/images/9gag.png";
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("East").out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `9gag.${image.outputType}`
});
};

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("North").resize(null, size.height).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `bandicam.${image.outputType}`
});
});

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to blur!`;
const command = gm(image.path).blur(10);
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `blur.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to make blurple!`;
const data = gm(image.path).threshold(75, true).out("+level-colors").out("\"#7289DA\",white");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `blurple.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to add radial blur!`;
const data = gm(image.path).coalesce().out("-radial-blur", 10);
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `circle.${image.outputType}`
});
};

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("Center").resize(null, size.height).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `deviantart.${image.outputType}`
});
});

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to explode!`;
const data = gm(image.path).coalesce().implode([-2]);
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `explode.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to flip!`;
const command = gm(image.path).flip();
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `flip.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to flop!`;
const command = gm(image.path).flop();
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `flop.${image.outputType}`
});
};

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("NorthEast").resize(null, size.height).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `funky.${image.outputType}`
});
});

View File

@ -9,8 +9,9 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to make a GameXplain thumbnail meme!`;
const template = "./assets/images/gamexplain.png";
const command = gm(template).background("white").out("null:").out("(").out(image.path).coalesce().out("-virtual-pixel", "transparent").resize("1181x571!").out(")").compose("over").gravity("Center").out("-geometry", "+0+40").out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `gamexplain.${image.outputType}`
});
};

View File

@ -18,8 +18,9 @@ exports.run = async (message) => {
gm(data2).flop().write(data, async (error) => {
if (error) throw error;
const command = gm(data2).extent(size.width, size.height).out("null:").out(data).geometry(`+${size.width / 2}+0`).out("-layers", "Composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `haah.${image.outputType}`
});
});

View File

@ -9,8 +9,9 @@ exports.run = async (message, args) => {
const template = "./assets/images/hbc.png";
const cleanedMessage = args.join(" ").toLowerCase().replace(/\n/g, " ");
const command = gm(template).gravity("Center").font("./assets/hbc.ttf").out("-kerning", "-5").fill("white").pointSize(96).drawText(0, 0, cleanedMessage);
const buffer = await gmToBuffer(command);
return message.channel.createMessage("", {
file: await gmToBuffer(command),
file: buffer,
name: "homebrew.png"
});
};

View File

@ -18,8 +18,9 @@ exports.run = async (message) => {
gm(data2).flip().write(data, async (error) => {
if (error) throw error;
const command = gm(data2).extent(size.width, size.height).out("null:").out(data).geometry(`+0+${size.height / 2}`).out("-layers", "Composite").out("-layers", "Optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `hooh.${image.outputType}`
});
});

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("NorthWest").resize(null, size.height).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `hypercam.${image.outputType}`
});
});

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const data = gm(image.path).coalesce().out("null:").out(watermark).gravity("South").resize(size.width, null).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `ifunny.${image.outputType}`
});
});

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to implode!`;
const data = gm(image.path).implode([1]);
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `implode.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to invert!`;
const data = gm(image.path).negative();
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `invert.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to add more JPEG!`;
const data = gm(image.path).setFormat("jpg").quality(1);
const buffer = await gmToBuffer(data);
return message.channel.createMessage("", {
file: await gmToBuffer(data),
file: buffer,
name: "jpeg.jpg"
});
};

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
const template = "./assets/images/leak.png";
const command = gm(template).out("-background").out("white").out("-gravity").out("Center").out("(").out("-clone").out("0").out("(").out(image.path).out("-virtual-pixel").out("white").out("-resize").out("640x360!").rotate("white", 15).out(")").out("-geometry").out("+450-200").out("-composite").out(")").out("+swap").out("-composite").out("-alpha").out("remove").out("-alpha").out("off");
// const command = gm(template).out("-background", "white").gravity("Center").out("null:").out("(").out(path).out("-resize", "640x360!").out("-virtual-pixel", "white").rotate("white", 15).coalesce().geometry("+450-200").out(")").compose("over").out("-alpha", "remove").out("-alpha", "off").out("-layers", "composite");
const buffer = await gmToBuffer(command);
return message.channel.createMessage("", {
file: await gmToBuffer(command),
file: buffer,
name: `leak.${image.outputType}`
});
};

View File

@ -21,8 +21,9 @@ exports.run = async (message, args) => {
gm().out("-size", size.width).background("none").gravity("Center").out("(", "(").font("Impact").out("-pointsize", 40).out(`pango:<span foreground='white'>${bottomText ? bottomText.toUpperCase().replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : " "}</span>`).out(")", "(", "+clone").out("-channel", "A").out("-morphology", "EdgeOut", "Octagon", "+channel", "+level-colors", "black", ")").compose("DstOver").out(")", "-composite").write(file3, async (error) => {
if (error) throw error;
const data = gm(file).out("-coalesce").out("null:").gravity("North").out(file2).out("-layers", "composite").out("null:").gravity("South").out(file3).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `meme.${image.outputType}`
});
});

View File

@ -9,8 +9,9 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to make a Scott the Woz TV meme!`;
const template = "./assets/images/scott.png";
const command = gm(template).out("null:").out("(").out(image.path).coalesce().out("-virtual-pixel", "transparent").resize("415x234!").out("+distort", "Perspective", "0,0 129,187 415,0 517,182 415,234 517,465 0,234 132,418").out(")").compose("over").gravity("Center").geometry("-238-98").out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `scott.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to sharpen!`;
const command = gm(image.path).coalesce().sharpen(10);
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `sharpen.${image.outputType}`
});

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
gm(image.path).size(async (error, size) => {
if (error) throw error;
const command = gm(image.path).coalesce().out("null:").out(watermark).gravity("Center").resize(null, size.height).out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `shutterstock.${image.outputType}`
});
});

View File

@ -13,8 +13,9 @@ exports.run = async (message, args) => {
gm(474, 332).out("+size").background("none").gravity("Center").out("-pointsize", 72).out("-font", "Bitstream Vera Sans").out(`pango:<span foreground="white">${wrap(cleanedMessage, {width: 15, indent: ""})}</span>`).write(file, async (error) => {
if (error) throw error;
const command = gm(template).composite(file).gravity("Center").geometry("474x332+160+10");
const buffer = await gmToBuffer(command, "png");
return message.channel.createMessage("", {
file: await gmToBuffer(command, "png"),
file: buffer,
name: "sonic.png"
});
});

View File

@ -22,8 +22,9 @@ exports.run = async (message) => {
} else {
const numbers = (await util.promisify(exec)(`seq 0 2 ${value.Scene.length}`)).stdout.split("\n").join(",");
const data = gm().out("(").out(image.path).coalesce().out(")").out("-delete", numbers).out("-layers", "optimize");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: "speed.gif"
});
}

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to stretch!`;
const data = gm(image.path).coalesce().resize("512x512!");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `stretch.${image.outputType}`
});
};

View File

@ -8,8 +8,9 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to swirl!`;
const data = gm(image.path).coalesce().swirl(180);
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `swirl.${image.outputType}`
});
};

View File

@ -10,8 +10,9 @@ exports.run = async (message) => {
gm(image.path).coalesce().command("montage").out("-duplicate").out(24).tile("5x5").geometry("+0+0").stream("miff", async (error, output) => {
if (error) throw error;
const data = gm(output).coalesce().resize("800x800>");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `tile.${image.outputType}`
});
});

View File

@ -9,8 +9,9 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to make a Trump meme!`;
const template = "./assets/images/trump.png";
const command = gm(template).background("white").out("null:").out("(").out(image.path).coalesce().out("-virtual-pixel", "transparent").resize("365x179!").out("+distort", "Perspective", "0,0 207,268 365,0 548,271 365,179 558,450 0,179 193,450").out(")").compose("over").gravity("Center").geometry("-217-135").out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `trump.${image.outputType}`
});
};

View File

@ -18,8 +18,9 @@ exports.run = async (message) => {
gm(data2).flop().write(data, async (error) => {
if (error) throw error;
const command = gm(data2).extent(size.width, size.height).out("null:").out(data).geometry(`+${size.width / 2}+0`).out("-layers", "Composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `waaw.${image.outputType}`
});
});

View File

@ -10,8 +10,9 @@ exports.run = async (message) => {
gm(image.path).coalesce().resize(128).stream("miff", async (error, output) => {
if (error) throw error;
const data = gm(output).coalesce().virtualPixel("tile").matteColor("none").out("-background", "none").resize("512x512!").out("-distort").out("Perspective").out("0,0,57,42 0,128,63,130 128,0,140,60 128,128,140,140");
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `wall.${image.outputType}`
});
});

View File

@ -9,8 +9,9 @@ exports.run = async (message) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image to make a "who did this" meme!`;
const template = "./assets/images/whodidthis.png";
const command = gm(template).coalesce().out("null:").out(image.path).gravity("Center").resize("374x374>").out("-layers", "composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `wdt.${image.outputType}`
});
};

View File

@ -11,8 +11,9 @@ exports.run = async (message) => {
if (error) throw error;
if (size.width > 10000) return `${message.author.mention}, this image is too wide!`;
const data = gm(image.path).coalesce().resize(`${(size.width * 19) / 2}x${size.height / 2}!`);
const buffer = await gmToBuffer(data, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(data, image.outputType),
file: buffer,
name: `wide.${image.outputType}`
});
});

View File

@ -18,8 +18,9 @@ exports.run = async (message) => {
gm(data2).flip().write(data, async (error) => {
if (error) throw error;
const command = gm(data2).extent(size.width, size.height).out("null:").out(data).geometry(`+0+${size.height / 2}`).out("-layers", "Composite").out("-layers", "optimize");
const buffer = await gmToBuffer(command, image.outputType);
return message.channel.createMessage("", {
file: await gmToBuffer(command, image.outputType),
file: buffer,
name: `woow.${image.outputType}`
});
});

View File

@ -21,7 +21,6 @@ const typeCheck = async (image, gifv = false) => {
return {
type: imageType.ext,
data: imageBuffer,
url: image,
outputType: imageType.ext === "mp4" ? "gif" : imageType.ext,
path: path
};