gchq/CyberChef · error · OperationError

Error blurring image. (${err})

Error message

Error blurring image. (${err})

What it means

This wraps any failure during the blur step (applying the kernel) and the buffer export step. If Jimp's blur/gaussian call or image.getBuffer throws, the outer catch rethrows it as OperationError with the underlying message.

Source

Thrown at src/core/operations/BlurImage.mjs:87

                        self.sendStatusMessage("Fast blurring image...");
                    image.blur(blurAmount);
                    break;
                case "Gaussian":
                    if (isWorkerEnvironment())
                        self.sendStatusMessage("Gaussian blurring image...");
                    image.gaussian(blurAmount);
                    break;
            }

            let imageBuffer;
            if (image.mime === "image/gif") {
                imageBuffer = await image.getBuffer(JimpMime.png);
            } else {
                imageBuffer = await image.getBuffer(image.mime);
            }
            return imageBuffer.buffer;
        } catch (err) {
            throw new OperationError(`Error blurring image. (${err})`);
        }
    }

    /**
     * Displays the blurred image using HTML for web apps
     *
     * @param {ArrayBuffer} data
     * @returns {html}
     */
    present(data) {
        if (!data.byteLength) return "";
        const dataArray = new Uint8Array(data);

        const type = isImage(dataArray);
        if (!type) {
            throw new OperationError("Invalid file type.");
        }

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Use a sane positive blurAmount within Jimp's documented range.
  2. For GIF input, convert to PNG/JPEG first or expect the re-encode path.
  3. Inspect err.message to distinguish blur failure from export failure.

Example fix

// before
blurAmount = -5
// after
blurAmount = 5
Defensive patterns

Strategy: validation

Validate before calling

if (!Number.isFinite(blurAmount) || blurAmount < 0) throw new Error('blurAmount must be a non-negative number');

Type guard

function isValidBlurAmount(n) { return Number.isFinite(n) && n >= 0 && n <= 1000; }

Try / catch

try { await blurImage.run(input, args); }
catch (e) { if (/Error blurring/.test(e.message)) { /* reduce image size or blur radius */ } else throw e; }

Prevention

When it happens

Trigger: BlurAmount out of Jimp's accepted range; Gaussian blur on an image Jimp cannot process; getBuffer failing for a mime type that cannot be re-encoded (e.g. GIF being converted to PNG).

Common situations: Passing a negative or very large blurAmount; feeding a GIF that triggers the PNG re-encode path with an unsupported frame layout; out-of-memory on very large images.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/6de1e120b218fb78. Report an issue: GitHub.