Fix spin I guess

This commit is contained in:
TheEssem 2020-06-08 17:04:26 -05:00
parent 24d7dd5085
commit 6e7dcc679f

View file

@ -6,7 +6,8 @@ exports.run = async (message) => {
const image = await require("../utils/imagedetect.js")(message); const image = await require("../utils/imagedetect.js")(message);
if (image === undefined) return `${message.author.mention}, you need to provide an image to spin!`; if (image === undefined) return `${message.author.mention}, you need to provide an image to spin!`;
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 resultBuffer = await gm(image.path).coalesce().out("-duplicate", "29").scale("256x256>").scale("256x256<").background("white").virtualPixel("background").out("-rotate", "%[fx:360*t/n]").set("delay", "5").set("dispose", "background").out("-loop", "0").bufferPromise("gif"); const seq = await gm(image.path).coalesce().out("-duplicate", "29").scale("256x256>").scale("256x256<").out("-alpha", "set").virtualPixel("transparent").out("-distort", "SRT", "%[fx:360*t/n]").set("delay", "5").out("-loop", "0").streamPromise("miff");
const resultBuffer = await gm(seq).in("-dispose", "background").bufferPromise("gif");
await processMessage.delete(); await processMessage.delete();
return { return {
file: resultBuffer, file: resultBuffer,