Added quality option to jpeg, adjusted CMakeLists, more tweaks

This commit is contained in:
Essem 2022-01-20 22:52:29 -06:00
parent 76fe5b6aa6
commit 715ed3bb7b
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
5 changed files with 26 additions and 14 deletions

View file

@ -1,11 +1,19 @@
import ImageCommand from "../../classes/imageCommand.js";
class JPEGCommand extends ImageCommand {
static description = "Adds max JPEG compression to an image";
static aliases = ["needsmorejpeg", "jpegify", "magik2", "morejpeg", "jpg"];
params() {
const quality = parseInt(this.args[0]);
return {
quality: isNaN(quality) ? 1 : Math.max(1, Math.min(quality, 100))
};
}
static description = "Adds JPEG compression to an image";
static aliases = ["needsmorejpeg", "jpegify", "magik2", "morejpeg", "jpg", "quality"];
static arguments = ["{quality}"];
static noImage = "You need to provide an image to add more JPEG!";
static command = "jpeg";
}
export default JPEGCommand;
export default JPEGCommand;

View file

@ -1,6 +1,6 @@
import ImageCommand from "../../classes/imageCommand.js";
import { random } from "../../utils/misc.js";
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "bellybros"];
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "thomastheplankengine"];
class RedditCommand extends ImageCommand {
params() {
@ -16,4 +16,4 @@ class RedditCommand extends ImageCommand {
static command = "reddit";
}
export default RedditCommand;
export default RedditCommand;