Skip to content

Test ImageChops.offset() with zero-size images - #9953

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
espressolee:test-offset-zero-size
Sep 4, 2026
Merged

radarhere merged 1 commit into
python-pillow:mainfrom
espressolee:test-offset-zero-size

Conversation

@espressolee

Copy link
Copy Markdown
Contributor

#9847 fixed a remainder by zero in ImagingOffset for zero-width or zero-height images. In review, @hugovk noted that the tests for (0, 1) and (1, 0) were missing from the PR; it merged with only the Offset.c change. This adds them, following the zero-size parameterization already used in Tests/test_image.py.

Without the fix the test dies with SIGFPE on x86-64 (10/10 runs against 22c1ea2a); with it, 10/10 pass. On the arm64 build the undefined remainder by zero does not trap, so the pre-fix build passes there — the ubuntu-latest and macos-26-intel jobs are the ones that would catch a regression.

Add regression coverage for zero-width and zero-height images, as
requested during review of python-pillow#9847. Without that fix the remainder by
zero in ImagingOffset dies with SIGFPE on x86-64.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@radarhere
radarhere merged commit 3f1eec6 into python-pillow:main Sep 4, 2026
63 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants