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

Raise the same error if a truncated image is loaded a second time #3965

Merged
merged 1 commit into from Sep 20, 2019

Conversation

@radarhere
Copy link
Member

radarhere commented Jul 12, 2019

Resolves #3863, and see also #2977, two issues that find it strange that Pillow is inconsistent between the first load() of a truncated image, and the second.

After load() is called on a truncated image, an error is raised and there is a line - self.tile = []. This means that when load() is called a second time, it thinks there is nothing to do and does not return the same truncated error. This logic has been present since the fork.

Instead, this PR removes that line, causing the same error to be raised on subsequent loads. It also resets an internal variable of PngImagePlugin, to fix an error that was raised when changing the tests for this, also providing consistency by resetting the image to it's initial state.

@hugovk hugovk mentioned this pull request Jul 15, 2019
@aclark4life aclark4life added this to New Issues in Pillow Sep 12, 2019
@hugovk hugovk merged commit 8e3c4e3 into python-pillow:master Sep 20, 2019
18 checks passed
18 checks passed
codecov/patch 100% of diff hit (target 82.12%)
Details
codecov/project 84.39% (+2.26%) compared to 1c57a41
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
python-pillow.Pillow Build #20190712.1 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:truncated branch Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pillow
  
New Issues
Linked issues

Successfully merging this pull request may close these issues.

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