Skip to content

Return 0 or -1 from ImagingSplit(), rather than number of bands - #9988

Open
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:split
Open

Return 0 or -1 from ImagingSplit(), rather than number of bands#9988
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:split

Conversation

@radarhere

Copy link
Copy Markdown
Member

The only time that ImagingSplit() is called, the result is only checked for success or failure.

Pillow/src/_imaging.c

Lines 2507 to 2509 in 0253ef0

if (!ImagingSplit(self->image, bands)) {
return NULL;
}

There's no reason it needs to return the number of bands.

return imIn->bands;

So let's return 0 for success and -1 for failure instead.

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.

1 participant