Fix delay bug on jpeg/deepfry, remove mc/blurple

This commit is contained in:
Essem 2022-06-08 12:17:57 -05:00
parent 4ac90bc761
commit 9d7ba365c8
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
5 changed files with 3 additions and 54 deletions

View file

@ -1,21 +0,0 @@
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class MCCommand extends Command {
async run() {
if (this.args.length === 0) return "You need to provide some text to generate a Minecraft achievement!";
await this.acknowledge();
const request = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=13&h=Achievement+get%21&t=${encodeURIComponent(this.args.join("+"))}`);
return {
file: Buffer.from(await request.arrayBuffer()),
name: "mc.png"
};
}
static description = "Generates a Minecraft achievement image";
static aliases = ["ach", "achievement", "minecraft"];
static arguments = ["[text]"];
static slashAllowed = false;
}
export default MCCommand;

View file

@ -1,28 +0,0 @@
import ImageCommand from "../../classes/imageCommand.js";
class BlurpleCommand extends ImageCommand {
params() {
return {
old: !!this.specialArgs.old,
color: "blurple"
};
}
static description = "Turns an image blurple";
static init() {
super.init();
this.flags.push({
name: "old",
description: "Use the old blurple color",
type: 5
});
return this;
}
static noImage = "You need to provide an image/GIF to make blurple!";
static command = "colors";
static aliases = ["blurp"];
}
export default BlurpleCommand;

View file

@ -26,9 +26,7 @@ Napi::Value Colors(const Napi::CallbackInfo &info) {
VImage out; VImage out;
if (color == "blurple") { if (color == "grayscale") {
out = in;
} else if (color == "grayscale") {
out = in.colourspace(VIPS_INTERPRETATION_B_W); out = in.colourspace(VIPS_INTERPRETATION_B_W);
} else if (color == "sepia") { } else if (color == "sepia") {
out = in.flatten().recomb(sepia); out = in.flatten().recomb(sepia);

View file

@ -32,7 +32,7 @@ Napi::Value Deepfry(const Napi::CallbackInfo &info) {
VImage::option()->set("Q", 1)->set("strip", true)); VImage::option()->set("Q", 1)->set("strip", true));
VImage final = VImage::new_from_buffer(jpgBuf, jpgLength, ""); VImage final = VImage::new_from_buffer(jpgBuf, jpgLength, "");
final.set(VIPS_META_PAGE_HEIGHT, page_height); final.set(VIPS_META_PAGE_HEIGHT, page_height);
final.set("delay", fried.get_array_int("delay")); if (type == "gif") final.set("delay", fried.get_array_int("delay"));
void *buf; void *buf;
size_t length; size_t length;

View file

@ -35,7 +35,7 @@ Napi::Value Jpeg(const Napi::CallbackInfo &info) {
VImage::option()->set("Q", quality)->set("strip", true)); VImage::option()->set("Q", quality)->set("strip", true));
VImage final = VImage::new_from_buffer(jpgBuf, jpgLength, ""); VImage final = VImage::new_from_buffer(jpgBuf, jpgLength, "");
final.set(VIPS_META_PAGE_HEIGHT, page_height); final.set(VIPS_META_PAGE_HEIGHT, page_height);
final.set("delay", in.get_array_int("delay")); if (type == "gif") final.set("delay", in.get_array_int("delay"));
void *buf; void *buf;
size_t length; size_t length;