Skip to content

Update JIMP#2171

Merged
GCHQDeveloper581 merged 25 commits intogchq:masterfrom
C85297:update-jimp
Feb 18, 2026
Merged

Update JIMP#2171
GCHQDeveloper581 merged 25 commits intogchq:masterfrom
C85297:update-jimp

Conversation

@C85297
Copy link
Copy Markdown
Member

@C85297 C85297 commented Feb 3, 2026

No description provided.

@C85297 C85297 self-assigned this Feb 3, 2026
@C85297 C85297 added the dependencies Pull requests that update a dependency file label Feb 3, 2026
@GCHQDeveloper581
Copy link
Copy Markdown
Contributor

I think your error may be related to what I was looking at in https://github.com/GCHQDeveloper581/CyberChef/tree/fix-issue-XXXX

@GCHQDeveloper581
Copy link
Copy Markdown
Contributor

Actually looking harder at the error returned, I think it's another issue I've (also previously) encountered with the root cause being that some Operations return a Value and others return a Promise. In the normal browser this seems to work out OK but when running under node it creates an issue.

@C85297
Copy link
Copy Markdown
Member Author

C85297 commented Feb 5, 2026

So I worked out the error was this:

    at Object.p [as next] (http://localhost:8000/modules/Image.js:2:1023389)
    at S (http://localhost:8000/modules/Image.js:2:1024030)
    at http://localhost:8000/modules/Image.js:2:1024950
    at transpile (http://localhost:8000/modules/Image.js:2:1024969)
    at convertXML (http://localhost:8000/modules/Image.js:2:1025103)
    at loadBitmapFontData (http://localhost:8000/modules/Image.js:2:1026062)
    at async loadFont (http://localhost:8000/modules/Image.js:2:1027310))" (1ms)

Which was caused by Jimp attempting to load the font file as XML (which it wasn't). It seems Jimp used to support BMFont text files, but now only supports BMFont XML files.

I created a simple program using bmfont_rs to convert the files to XML:

fn main() -> bmfont_rs::Result<()> {
    for fnt_in_fname in std::env::args().skip(1) {
        let fnt_in_path = std::path::PathBuf::from(&fnt_in_fname);
        let fnt = bmfont_rs::text::from_bytes(&std::fs::read(&fnt_in_path)?)?;
        let fnt_out_path = fnt_in_path
            .with_extension("")
            .with_added_extension("fnt")
            .with_added_extension("xml");
        std::fs::write(&fnt_out_path, bmfont_rs::xml::to_vec(&fnt)?)?;
        println!("{:?} -> {:?}", fnt_in_path, fnt_out_path);
    }
    Ok(())
}

As the font files had incorrect negative spacing values, I had to remove the signs on these and re-add them on the outputted XML files.

@C85297
Copy link
Copy Markdown
Member Author

C85297 commented Feb 5, 2026

The output of Add Text To Image has slightly changed.

Previously:
image

Now:
image

Although in this case it looks correct testing on a larger image shows the alignment is broken:

Previously:
image

Now:
image

Copy link
Copy Markdown
Contributor

@GCHQDeveloper581 GCHQDeveloper581 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of observations which I'd like explicit confirmation are intended/investigated before approving.

@GCHQDeveloper581 GCHQDeveloper581 merged commit c97baa6 into gchq:master Feb 18, 2026
2 checks passed
@C85297 C85297 mentioned this pull request Feb 20, 2026
mkilijanek pushed a commit to mkilijanek/CyberChef that referenced this pull request Feb 23, 2026
Incorporates 37 upstream commits from gchq/CyberChef master including:
- Fix: Move Magic checks from Escape to Unescape Unicode Characters (gchq#2195)
- Paste spreadsheets as text (gchq#2200)
- Fix Roboto Mono font (gchq#2199)
- Fix return of buffer for PNG QR image generation (gchq#2125)
- Update JIMP (gchq#2171)
- Bump v10.22.1 (gchq#2193)
- Bump v10.22.0 (gchq#2189)
- Fixed Percent delimiter for hex encoding (gchq#2137)
- Added ability to paste Images from Clipboard (gchq#1876)
- Quoted Printable improvements (gchq#2186)
- Fix freeze when output text decoding fails (gchq#1573)
- Fix import operations with special chars (gchq#1040)
- Add Bech32 encode/decode operations
- Various bug fixes and improvements

Conflict resolution:
- Workflow files: kept Node 24 + actions@v4 (local upgrade)
- package.json: kept jsonwebtoken 9.0.0, fixJimpModule postinstall, added upstream 'tag' script
- package-lock.json: kept local version (consistent with jimp 1.6.0 install)
- sitemap.mjs: kept modern 'with' import assertion syntax
- Code.mjs: kept escaped curly brace regex for Node 24 compatibility
- newMinorVersion.mjs: added upstream ignoredAuthors constant

https://claude.ai/code/session_011xozAMdxys1JF7nLRQsMtg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants