Updated eslint, Jimp, and other dependencies

This commit is contained in:
n1474335 2024-06-11 18:07:22 +01:00
parent 7eb887ca51
commit 2b275f0897
No known key found for this signature in database
GPG key ID: D15457B7B4AF3F37
35 changed files with 2939 additions and 1926 deletions

View file

@ -9,7 +9,7 @@ import OperationError from "../errors/OperationError.mjs";
import { isImage } from "../lib/FileType.mjs";
import { toBase64 } from "../lib/Base64.mjs";
import { isWorkerEnvironment } from "../Utils.mjs";
import jimp from "jimp";
import Jimp from "jimp/es/index.js";
/**
* Crop Image operation
@ -99,7 +99,7 @@ class CropImage extends Operation {
let image;
try {
image = await jimp.read(input);
image = await Jimp.read(input);
} catch (err) {
throw new OperationError(`Error loading image. (${err})`);
}
@ -119,9 +119,9 @@ class CropImage extends Operation {
let imageBuffer;
if (image.getMIME() === "image/gif") {
imageBuffer = await image.getBufferAsync(jimp.MIME_PNG);
imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG);
} else {
imageBuffer = await image.getBufferAsync(jimp.AUTO);
imageBuffer = await image.getBufferAsync(Jimp.AUTO);
}
return imageBuffer.buffer;
} catch (err) {