|
From: Rich S. <rsi...@us...> - 2012-10-19 14:59:18
|
MPL folks, Would it be possible to enhance Matplotlib to allow "im=imread(url)" to work if url returns a JPG? Currently (it seems): 1. If the URL returns a PNG this works: im = imread(urllib2.urlopen(url)) 2. If the URL returns a JPG, this DOESN'T work: im = imread(urllib2.urlopen(url)) .. and neither does this: im = imread(urllib2.urlopen(url),format='jpg') ... but this DOES work: im = Image.open(cStringIO.StringIO(urllib.urlopen(url).read())) See an example in Ipython Notebook here: http://nbviewer.ipython.org/3918576/ So could just be hidden from the user so that "im = imread(url)" would just work for JPG (assuming PIL was installed)? Thanks, Rich -- Dr. Richard P. Signell USGS, 384 Woods Hole Rd. Woods Hole, MA 02543-1598 |