Skip to content

Accept tabs in XBM header definitions - #10504

Closed
Lushiyao5 wants to merge 1 commit into
python-pillow:mainfrom
Lushiyao5:fix/xbm-tab-delimited-defines-20261114
Closed

Lushiyao5 wants to merge 1 commit into
python-pillow:mainfrom
Lushiyao5:fix/xbm-tab-delimited-defines-20261114

Conversation

@Lushiyao5

Copy link
Copy Markdown
Contributor

Description of change

The line-based XBM parser introduced in #10109 reads space-separated #define lines, but rejects definitions such as #define\ticon_width 32 or #define icon_width\t32. The preceding parser accepted both spellings.

Identify the directive and field name by splitting the line into tokens. Add a regression that reads an XBM with tabs in its dimensions and hotspot definitions, then checks its pixels and hotspot against the expected values.

Status of validation

  • Regression on the upstream plugin: 1 failed, 13 passed. With the patch: 14 passed.
  • Pillow's installed-wheel self-test: 59 passed. Ruff and git diff --check passed.
  • Windows, CPython 3.12.10. The XBM suite loaded the checkout's Python plugin using the installed Pillow 13.0.0 binary and matching core modules. Both runs used the same test-only adjustment for the newer plugin's _Tile default. The full source build and CI matrix were not run locally.

OpenAI Codex assisted with investigating the regression, preparing this patch and running the checks.

Assisted-by: OpenAI Codex <support@openai.com>
@radarhere radarhere added the 🤖-assisted AI-assisted label Nov 14, 2026
@radarhere

Copy link
Copy Markdown
Member

Is there something in a specification that alludes to this possibility? https://github.com/syntelos/xbm/blob/master/README.txt doesn't mention anything about tabs or different kinds of whitespace.

Or are there real world files that are formatted like this?

Otherwise, I'm not inclined to accept a type of data purely because we once did.

@radarhere radarhere closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-assisted AI-assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants