mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Add status messages for image operations
This commit is contained in:
parent
833c1cd98f
commit
4a7ea469d4
8 changed files with 24 additions and 3 deletions
|
@ -59,8 +59,16 @@ class ImageBrightnessContrast extends Operation {
|
|||
}
|
||||
|
||||
const image = await jimp.read(Buffer.from(input));
|
||||
image.brightness(brightness / 100);
|
||||
image.contrast(contrast / 100);
|
||||
if (brightness !== 0) {
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
self.sendStatusMessage("Changing image brightness...");
|
||||
image.brightness(brightness / 100);
|
||||
}
|
||||
if (contrast !== 0) {
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
self.sendStatusMessage("Changing image contrast...");
|
||||
image.contrast(contrast / 100);
|
||||
}
|
||||
|
||||
const imageBuffer = await image.getBufferAsync(jimp.AUTO);
|
||||
return [...imageBuffer];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue