Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

XBM loader is too strict on variable name

Open Beginner friendly
#10,087 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with the xbm_head definition in Pillow-12.3.0/src/PIL/XbmImagePlugin.py and reproduce the failure using the hopper_xbm example from the issue. The fix is done when XBM files whose variable name does not end in _bits or _xbm can be opened without breaking the existing hopper_bits case.

Written by the indexing model from the issue text.

Description

Pillow fails to open almost all my xbm files.
The reason is the xbm_head in Pillow-12.3.0/src/PIL/XbmImagePlugin.py

It hard-codes the fact that the variable name must ends with "_bits", which is maybe a common
practice, but definitely not a requirement.

So this will load:

#define hopper_width 128
#define hopper_height 128
static char hopper_bits[] = {...

But this one wont:

#define hopper_width 128
#define hopper_height 128
static char hopper_xbm[] = {...

_xbm is another common suffix, but please dont restrict to ony _xbm and _bits !

Dominant language
Python
Stars
13.9k
Forks
2.5k
Avg merge
1d 6h
Merged PRs (30d)
98

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-pillow/Pillow

All issues in python-pillow/Pillow

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.