This code passes urllib2 Open remote picture , adopt cStringIO Read file contents , The information of the picture file can be read without saving to the disk
#!/usr/bin/env python encoding=utf-8 import cStringIO, urllib2, Image url = 'http://com/wp-content/uploads/2012/09/bg.png' file = urllib2.urlopen(url) tmpIm = cStringIO.StringIO(file.read()) im = Image.open(tmpIm) print im.format, im.size, im.mode</pre>