Skip to content

Simplify handling of remote JPGs #4252

Closed
@rsignell-usgs

Description

@rsignell-usgs

Would it be possible to enhance Matplotlib to allow "im=imread(url)"
to work if url returns a JPG?

Currently (it seems):

  • If the URL returns a PNG this works:
im = imread(urllib2.urlopen(url))
  • 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)?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions