def get_temp_imagefilename(url):
 img = _urlopen(url).read()
 im = Image.open(BytesIO(img))
 f = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
 fname = f.name
 f.close()
 im.save(fname, 'PNG')
 return fname

def get_temp_imagefilename ( url ) : img = _urlopen ( url ) . read ( ) im = Image . open ( BytesIO ( img ) ) f = tempfile . NamedTemporaryFile ( delete = False , suffix = '.png' ) fname = f . name f . close ( ) im . save ( fname , 'PNG' ) return fname
returns filename of temporary file containing downloaded image .