-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
File object support for imread and imsave #3124
Conversation
Thanks for the fix. I'll try to have a closer look at this in a few days. It's indeed ugly that we have two |
OK I'm not going to get around to reworking the |
@@ -100,21 +100,21 @@ def bytescale(data, cmin=None, cmax=None, high=255, low=0): | |||
return cast[uint8](bytedata) + cast[uint8](low) | |||
|
|||
|
|||
def imread(name,flatten=0): | |||
def imread(imfile, flatten=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a backwards compatibility break, because you can use positional arguments like kwargs (like imread(name='fname.png')
). So can you undo this change?
Can you add a test for the functionality you add here to |
With a test and undoing the rename this should be good to go. |
Finally got around to make these changes. |
ENH: misc: File object support for imread and imsave
Thanks, merged. |
Made changes to image reading and writing routines to support file objects properly. Actually scipy.misc.imread didn't have to be changed because PIL already supports file objects, but I changed the docstring to say explicitly that it supports them. I made similar changes to scipy.ndimage.misc.imread, though I'm not quite sure why that can't just import from scipy.misc.