Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow floodfill to extend into negative coordinates #4017

Merged
merged 1 commit into from Sep 5, 2019

Conversation

@radarhere
Copy link
Member

radarhere commented Aug 9, 2019

Resolves #4016

At the moment, ImageDraw.floodfill doesn't stop filling new pixels just because their coordinates happen to be negative - when filling the next pixels around (0, 0), it also uses (-1, -1). So it continues, and wraps around to the other side of the image.

To demonstrate, with this image -

base

filling a coordinate in the upper left of this image before this fix gives -

out

This PR fixes it -

imagedraw_floodfill_not_negative

@radarhere radarhere mentioned this pull request Aug 9, 2019
@radarhere radarhere added the Bug label Aug 9, 2019
@radarhere radarhere force-pushed the radarhere:floodfill branch from bda4941 to 23872c0 Aug 11, 2019
@hugovk hugovk merged commit cb1ebc0 into python-pillow:master Sep 5, 2019
18 checks passed
18 checks passed
codecov/patch Coverage not affected when comparing 6de118a...23872c0
Details
codecov/project 82.36% (+0.05%) compared to 6de118a
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
python-pillow.Pillow Build #20190811.9 succeeded
Details
python-pillow.Pillow (Lint Python37) Lint Python37 succeeded
Details
python-pillow.Pillow (alpine) alpine succeeded
Details
python-pillow.Pillow (amazon_1_amd64) amazon_1_amd64 succeeded
Details
python-pillow.Pillow (amazon_2_amd64) amazon_2_amd64 succeeded
Details
python-pillow.Pillow (arch) arch succeeded
Details
python-pillow.Pillow (centos_6_amd64) centos_6_amd64 succeeded
Details
python-pillow.Pillow (centos_7_amd64) centos_7_amd64 succeeded
Details
python-pillow.Pillow (debian_10_buster_x86) debian_10_buster_x86 succeeded
Details
python-pillow.Pillow (debian_9_stretch_x86) debian_9_stretch_x86 succeeded
Details
python-pillow.Pillow (fedora_29_amd64) fedora_29_amd64 succeeded
Details
python-pillow.Pillow (fedora_30_amd64) fedora_30_amd64 succeeded
Details
python-pillow.Pillow (ubuntu_16_04_xenial_amd64) ubuntu_16_04_xenial_amd64 succeeded
Details
python-pillow.Pillow (ubuntu_18_04_bionic_amd64) ubuntu_18_04_bionic_amd64 succeeded
Details
@radarhere radarhere deleted the radarhere:floodfill branch Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.