mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Updated eslint, Jimp, and other dependencies
This commit is contained in:
parent
7eb887ca51
commit
2b275f0897
35 changed files with 2939 additions and 1926 deletions
|
@ -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})`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue