Skip to content

png: initialize _n_frames#4519

Closed
pmrowla wants to merge 2 commits intopython-pillow:masterfrom
pmrowla:4518-png-seek-eof
Closed

png: initialize _n_frames#4519
pmrowla wants to merge 2 commits intopython-pillow:masterfrom
pmrowla:4518-png-seek-eof

Conversation

@pmrowla
Copy link
Copy Markdown
Contributor

@pmrowla pmrowla commented Apr 3, 2020

Fixes #4518

Changes proposed in this pull request:

  • after the original APNG changes, ImageFile._seek_check() won't raise EOF for out of bounds seek unless _n_frames is properly set for standard (non-animated) PNG images

- ImageFile._seek_check() will not EOF unless _n_frames is properly set
  for standard (non-animated) PNG images
@pmrowla
Copy link
Copy Markdown
Contributor Author

pmrowla commented Apr 3, 2020

scikit-image with Pillow from PR branch:

scikit-image git:master  py:scikit-image ❯ pip freeze|egrep "Pillow|scikit-image"
Pillow==7.2.0.dev0
scikit-image==0.16.2

scikit-image git:master  py:scikit-image ❯ python
Python 3.7.7 (default, Mar 10 2020, 15:43:33)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from skimage import data
>>> data.camera().astype('float')
array([[156., 157., 160., ..., 152., 152., 152.],
       [156., 157., 159., ..., 152., 152., 152.],
       [158., 157., 156., ..., 152., 152., 152.],
       ...,
       [121., 123., 126., ..., 121., 113., 111.],
       [121., 123., 126., ..., 121., 113., 111.],
       [121., 123., 126., ..., 121., 113., 111.]])
>>>

(using Pillow 7.1.1 or master reproduces #4518 )

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2020

Codecov Report

Merging #4519 into master will decrease coverage by 0.19%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #4519     +/-   ##
=========================================
- Coverage   89.81%   89.62%   -0.2%     
=========================================
  Files         329      327      -2     
  Lines       40898    40891      -7     
=========================================
- Hits        36731    36647     -84     
- Misses       4167     4244     +77
Flag Coverage Δ
#AppVeyor ?
#GHA_Docker 85.88% <100%> (-0.04%) ⬇️
#GHA_Ubuntu 87.99% <100%> (-0.02%) ⬇️
#GHA_Windows 89.92% <100%> (-1.07%) ⬇️
#GHA_macOS 86.99% <100%> (-0.03%) ⬇️
#TravisCI 92.49% <100%> (-0.18%) ⬇️
Impacted Files Coverage Δ
Tests/test_file_png.py 100% <100%> (ø) ⬆️
src/PIL/PngImagePlugin.py 91.88% <100%> (+0.01%) ⬆️
Tests/test_imagefont_bitmap.py 91.3% <0%> (-8.7%) ⬇️
src/PIL/PyAccess.py 82.48% <0%> (-7.35%) ⬇️
Tests/test_lib_pack.py 94.3% <0%> (-5.7%) ⬇️
Tests/test_image_quantize.py 92.45% <0%> (-5.67%) ⬇️
Tests/test_features.py 96.92% <0%> (-3.08%) ⬇️
src/PIL/ImageTk.py 73.59% <0%> (-2.41%) ⬇️
src/PIL/features.py 95.78% <0%> (-2.11%) ⬇️
Tests/test_file_webp.py 98% <0%> (-2%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c9100e...2e6adc5. Read the comment docs.

@pmrowla
Copy link
Copy Markdown
Contributor Author

pmrowla commented Apr 3, 2020

CI error is some issue w/building qt on travis for the tox/lint step and is unrelated to these changes

@pmrowla
Copy link
Copy Markdown
Contributor Author

pmrowla commented Apr 5, 2020

closing in favor of #4528

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.

AttributeError: 'NoneType' object has no attribute 'read'

1 participant