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

Allow non-string, non-mpl Figure types in pictures.add #927

Open
alexlemann opened this Issue Aug 14, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@alexlemann

alexlemann commented Aug 14, 2018

utils.process_image as called by pictures.add requires images passed in as file paths or mpl Figure instances. On the other hand, PIL.Image.open() which is used in the filename case takes a filename OR a file like object. Relying on duck typing and being able to use eg BytesIO would be more flexible in allowing for non-disk data stores to be used without intermediary disk I/O.

See:

if isinstance(image, string_types):

elif mpl and isinstance(image, mpl.figure.Figure):

raise TypeError("Don't know what to do with that image object")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment