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

@ -10,7 +10,7 @@ import OperationError from "../errors/OperationError.mjs";
import jsQR from "jsqr";
import qr from "qr-image";
import Utils from "../Utils.mjs";
import jimp from "jimp";
import Jimp from "jimp/es/index.js";
/**
* Parses a QR code image from an image
@ -22,7 +22,7 @@ import jimp from "jimp";
export async function parseQrCode(input, normalise) {
let image;
try {
image = await jimp.read(input);
image = await Jimp.read(input);
} catch (err) {
throw new OperationError(`Error opening image. (${err})`);
}
@ -33,8 +33,8 @@ export async function parseQrCode(input, normalise) {
image.background(0xFFFFFFFF);
image.normalize();
image.greyscale();
image = await image.getBufferAsync(jimp.MIME_JPEG);
image = await jimp.read(image);
image = await image.getBufferAsync(Jimp.MIME_JPEG);
image = await Jimp.read(image);
}
} catch (err) {
throw new OperationError(`Error normalising image. (${err})`);