diff --git a/src/core/operations/ExtractLSB.mjs b/src/core/operations/ExtractLSB.mjs index 72d080883..cd6128d36 100644 --- a/src/core/operations/ExtractLSB.mjs +++ b/src/core/operations/ExtractLSB.mjs @@ -77,6 +77,10 @@ class ExtractLSB extends Operation { height = parsedImage.bitmap.height, rgba = parsedImage.bitmap.data; + if (bit < 0 || bit > 7) { + throw new OperationError("Error: Bit argument must be between 0 and 7"); + } + let i, combinedBinary = ""; if (pixelOrder === "Row") {