mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Tests + Bug Fixes
* Test cases for LSB extraction, RGBA extraction and bit plane browsing * Bug fix for alpha planes in bit plane browser
This commit is contained in:
parent
48831225ac
commit
950a12360e
3 changed files with 59 additions and 4 deletions
|
@ -62,7 +62,6 @@ class ViewBitPlane extends Operation {
|
|||
throw new OperationError("Error: Bit argument must be between 0 and 7");
|
||||
}
|
||||
|
||||
parsedImage.rgba(true);
|
||||
|
||||
let pixel, bin, newPixelValue;
|
||||
|
||||
|
@ -73,9 +72,11 @@ class ViewBitPlane extends Operation {
|
|||
|
||||
if (bin.charAt(bitIndex) === "1") newPixelValue = 0;
|
||||
|
||||
for (let i=0; i < 4; i++) {
|
||||
for (let i=0; i < 3; i++) {
|
||||
this.bitmap.data[idx + i] = newPixelValue;
|
||||
}
|
||||
this.bitmap.data[idx + 3] = 255;
|
||||
|
||||
});
|
||||
|
||||
const imageBuffer = await parsedImage.getBufferAsync(jimp.AUTO);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue