-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
SeekableFileObject needs readline()
for Pillow plugin
#1007
Comments
forgot to mention, adding in def readline(self):
return self.read(100) fixes the crash and allows imageio to open my image, by the way. |
readline()
for Pillow plugin
How come? Assuming you pass a URL and the file either ends with a JPEG suffix (e.g.
If you already know you want to read using
Since
The plugin you are quoting here is the plugin for reading
The problem with setting I am still not convinced we want to add Regarding the actual problem of ImageIO being unable to read a large JPEG from S3, are you able to share a code snippet that reproduces the failure? Walking over all plugins and trying them out is expensive and more of a last resort than something we want to do on a regular basis. If we can avoid this by doing something smart during plugin selection I'd be quite interested in this option. |
Hey all,
I've found an issue, and it's stopping imageio from trying every plugin and eventually saying a certain image not supported.
I'm trying to open a url of a larger JPG from an s3 storage. It's unable to ascertain the file-type so that it goes for the "try every plugin" approach:
in imopen, if we can't find the resource, we will "try everything" here
We use
Request
which will return a SeekableFileObject as shown hereUsing Pillow
ImImagePlugin
to read a file, we attempt a readline as seen here @ PillowBut
SeekableFileObject
does not have readline, causing an error. https://github.com/imageio/imageio/blob/master/imageio/core/request.py#L653The text was updated successfully, but these errors were encountered: