mirror of
https://github.com/gchq/CyberChef.git
synced 2026-03-27 01:01:23 -07:00
- Creates src/core/lib/Jimp.mjs to centralize Jimp instance with WebP support\n- Updates all image operations to use the centralized Jimp wrapper\n- Enables WEBP as an output format in 'Convert Image Format' operation\n- Adds quality support for WebP output
21 lines
498 B
JavaScript
21 lines
498 B
JavaScript
/**
|
|
* Jimp image library with additional plugins.
|
|
*
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
* @copyright Crown Copyright 2024
|
|
* @license Apache-2.0
|
|
*/
|
|
|
|
import { Jimp as BaseJimp, JimpMime, PNGFilterType, ResizeStrategy, EdgeAction } from "jimp";
|
|
import webp from "@jimp/wasm-webp";
|
|
|
|
/**
|
|
* Configure Jimp with WebP support
|
|
*/
|
|
const Jimp = new BaseJimp({
|
|
plugins: [webp],
|
|
formats: [webp]
|
|
});
|
|
|
|
export { Jimp, JimpMime, PNGFilterType, ResizeStrategy, EdgeAction };
|
|
export default Jimp;
|