#10087·Pillow

XBM loader is too strict on variable name

Author: orzelCreated Sep 30, 2026Updated Oct 1, 2026

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 won't:

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

_xbm is another common suffix, but please don't restrict to only _xbm and _bits!