Skip to content

Allow None extents in C setimage()#9504

Merged
hugovk merged 2 commits intopython-pillow:mainfrom
radarhere:setimage
Mar 31, 2026
Merged

Allow None extents in C setimage()#9504
hugovk merged 2 commits intopython-pillow:mainfrom
radarhere:setimage

Conversation

@radarhere
Copy link
Copy Markdown
Member

@radarhere radarhere commented Mar 26, 2026

Follow up from #9395

@hugovk
Copy link
Copy Markdown
Member

hugovk commented Mar 26, 2026

Could this be considered a breaking change? Although it's fixing unusual and perhaps undocumented behaviour.

Might be worth adding a brief note in the release notes? We could also wait for the Pillow 13.0.0 release in October, but that's probably unnecessary?

@radarhere radarhere changed the title Simplify setimage() by always using extents Simplify setimage() Mar 27, 2026
@radarhere
Copy link
Copy Markdown
Member Author

#9395 changed the C setimage() so extents needed to be passed in. However, I've realised that both before and after that, the C setimage() never accepted None.

For background, #1938 added the Python setimage(), which accepted None for the extents, and tested for it accordingly. #8285 added None as a possible value to the extents type hint in a tile.

I think we should aim for the same behaviour with the C and Python setimage(). It is fair enough to say that removing None as a possible extents value for Python setimage() is a breaking change, so I'm now going in the opposite direction with this PR - allowing None as an extents value in the C setimage().

@radarhere radarhere changed the title Simplify setimage() Allow None extents in C setimage() Mar 28, 2026
@hugovk hugovk merged commit 6dfc2be into python-pillow:main Mar 31, 2026
67 of 68 checks passed
@radarhere radarhere deleted the setimage branch March 31, 2026 20:58
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