Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #963 from cgohlke/patch-1

Add detection of file extension for file-like objects
  • Loading branch information...
commit cbb11da327ae48c790b908ed731d9fe49cfd7f12 2 parents 2c85848 + 78ba714
@WeatherGod WeatherGod authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/matplotlib/image.py
View
3  lib/matplotlib/image.py
@@ -1170,6 +1170,9 @@ def pilread():
if cbook.is_string_like(fname):
basename, ext = os.path.splitext(fname)
ext = ext.lower()[1:]
+ elif hasattr(fname, 'name'):
+ basename, ext = os.path.splitext(fname.name)
+ ext = ext.lower()[1:]
else:
ext = 'png'
else:
Please sign in to comment.
Something went wrong with that request. Please try again.