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

Pillow>7.0.0 PngImageFile object has no attribute '_PngImageFile_frame' #4548

Closed
FRUEHNI1 opened this issue Apr 2, 2020 · 4 comments
Closed

Comments

@FRUEHNI1
Copy link

FRUEHNI1 commented Apr 2, 2020

Description

Works with Pillow==7.0.0, not working with Pillow==7.1.0

img = imread("anyimage.png")
test/test_image_preprocess.py:7: in <module>
    img = imread("examples/data/test.png")
/usr/local/lib/python3.7/site-packages/skimage/io/_io.py:48: in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
/usr/local/lib/python3.7/site-packages/skimage/io/manage_plugins.py:210: in call_plugin
    return func(*args, **kwargs)
/usr/local/lib/python3.7/site-packages/skimage/io/_plugins/imageio_plugin.py:10: in imread
    return np.asarray(imageio_imread(*args, **kwargs))
/usr/local/lib/python3.7/site-packages/imageio/core/functions.py:223: in imread
    return reader.get_data(0)
/usr/local/lib/python3.7/site-packages/imageio/core/format.py:339: in get_data
    im, meta = self._get_data(index, **kwargs)
/usr/local/lib/python3.7/site-packages/imageio/plugins/pillow.py:296: in _get_data
    im, info = PillowFormat.Reader._get_data(self, index)
/usr/local/lib/python3.7/site-packages/imageio/plugins/pillow.py:172: in _get_data
    i = self._im.tell()
/usr/local/lib/python3.7/site-packages/PIL/PngImagePlugin.py:827: in tell
    return self.__frame
E   AttributeError: 'PngImageFile' object has no attribute '_PngImageFile__frame'
@hmaarrfk
Copy link
Member

hmaarrfk commented Apr 2, 2020

from the stack trace, this seems like a PIL issue, but I can't be sure.

@hmaarrfk
Copy link
Member

hmaarrfk commented Apr 2, 2020

can you read a PNG directly with PIL or imageio?

@hugovk
Copy link
Contributor

hugovk commented Apr 3, 2020

This was a problem in Pillow 7.1.0, fixed in 7.1.1. Please could you upgrade and try again?

python-pillow/Pillow#4509

sciunto added a commit to sciunto/scikit-image that referenced this issue Apr 3, 2020
@sciunto
Copy link
Member

sciunto commented Apr 3, 2020

Thanks @hugovk ! It solves the issue on my side. I'm closing this issue. If some still have the issue after update, please, reopen.

@sciunto sciunto closed this as completed Apr 3, 2020
sciunto added a commit to sciunto/scikit-image that referenced this issue Apr 3, 2020
rfezzani pushed a commit that referenced this issue Apr 3, 2020
* Blacklist pillow 7.1.0, see #4548

Add issue number

* Add issue number for imread blacklisting

* Fix blacklisting justifications

* Blacklist 0.7.1

* add note
kba added a commit to OCR-D/core that referenced this issue Jun 26, 2020
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

No branches or pull requests

4 participants