Skip to content

XBM loader is too strict on variable name #10087

Description

@orzel

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions