Skip to content

Raise ValueError if FPX tile size is not 64px by 64px#9660

Merged
radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:fpx_tile
Jun 29, 2026
Merged

Raise ValueError if FPX tile size is not 64px by 64px#9660
radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:fpx_tile

Conversation

@radarhere

Copy link
Copy Markdown
Member

Page 52 (or 42 if you're looking at the printed numbers) of https://graphcomp.com/info/specs/livepicture/fpx.pdf states that

Tile width field
This field specifies the width of a tile in pixels. The tile width must be 64 pixels.

Tile height field
This field specifies the height of a tile in pixels. The tile height must be 64 pixels.

@mergify

mergify Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Comment thread Tests/test_file_fpx.py Outdated
Comment thread Tests/test_file_fpx.py Outdated
Comment thread src/PIL/FpxImagePlugin.py
xtile, ytile = i32(s, 16), i32(s, 20)
if xtile != 64 or ytile != 64:
msg = "Tile must be 64 pixels by 64 pixels"
raise ValueError(msg)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ValueError seems the right choice, although we're already raising OSError for other things which should probably be ValueError (if we were writing from scratch).

Maybe use OSError here for consistency? Or ValueError for any new ones? I don't mind too much either way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Could go either way. I'm more inclined towards what is theoretically correct.

radarhere and others added 2 commits June 29, 2026 09:28
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@radarhere radarhere merged commit 92e0e5f into python-pillow:main Jun 29, 2026
58 of 61 checks passed
@radarhere radarhere deleted the fpx_tile branch June 29, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants