Skip to content

Raise LimitError when a clipped page exceeds the precision bound - #735

Merged
yhay81 merged 1 commit into
mainfrom
codex/728-clip-page-side
Nov 6, 2026
Merged

yhay81 merged 1 commit into
mainfrom
codex/728-clip-page-side

Conversation

@yhay81

@yhay81 yhay81 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Closes #728

A clipped render whose transformed page exceeds 524,288 pixels on either side now raises pyropdf.LimitError with code clip_page_side. The diagnostic includes the transformed dimensions and the pixel limit. The renderer reads the existing bound from the limit registry. The API reference and rendering guides document the exception.

Acceptance

  • The registered code and the 524,288-pixel bound appear in the generated limit table. The issue's 2,384,000 × 1,684,000 pixel reproduction raises LimitError with the expected code.
  • The public tests render a clip at the exact bound and check the error class, code and diagnostic with either dimension one pixel over. The clipped output raster's width, height and area tests also pass.

Verification

  • python3 tools/check.py --locked python and python3 tools/check.py --locked rust passed on macOS arm64. Python had 8,161 passed and 8 skipped.
  • The six focused boundary cases passed. tools/generate_limits.py --check and tools/api_reference.py --check also passed.

@yhay81
yhay81 merged commit 9000040 into main Nov 6, 2026
16 checks passed
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.

Raise LimitError, not ValueError, when a clipped render exceeds 524,288 pixels a side

1 participant