2021-08-19 14:19:14 +00:00
|
|
|
import ImageCommand from "../../classes/imageCommand.js";
|
2021-05-04 21:28:34 +00:00
|
|
|
|
|
|
|
class UncaptionCommand extends ImageCommand {
|
2022-04-05 03:05:28 +00:00
|
|
|
params() {
|
|
|
|
const tolerance = parseFloat(this.specialArgs.tolerance);
|
|
|
|
return {
|
|
|
|
tolerance: isNaN(tolerance) ? 0.95 : tolerance
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
static init() {
|
|
|
|
super.init();
|
2022-03-31 05:42:03 +00:00
|
|
|
this.flags.push({
|
|
|
|
name: "tolerance",
|
|
|
|
type: 10,
|
|
|
|
description: "Set the shade tolerance for the caption detection (0.0 is highest, 1.0 is lowest, default is 0.95)",
|
|
|
|
min_value: 0,
|
|
|
|
max_value: 1
|
|
|
|
});
|
2022-04-05 03:05:28 +00:00
|
|
|
return this;
|
2022-02-17 14:46:02 +00:00
|
|
|
}
|
|
|
|
|
2021-05-04 21:28:34 +00:00
|
|
|
static description = "Removes the caption from an image";
|
|
|
|
|
2022-01-26 18:53:20 +00:00
|
|
|
static noImage = "You need to provide an image/GIF to uncaption!";
|
2021-05-04 21:28:34 +00:00
|
|
|
static command = "uncaption";
|
|
|
|
}
|
|
|
|
|
2022-01-26 18:53:20 +00:00
|
|
|
export default UncaptionCommand;
|