python3.5在内存中获取远程图片尺寸
自已看看,用于获取选程图片的尺寸
>>> from io import BytesIO
>>> import requests as rs
>>> from PIL import Image
#图片地址是一个京东的图片
>>> url='https://img14.360buyimg.com/n0/jfs/t2035/332/2740607818/88242/f6d86c06/56f0f8abN0b22c105.jpg'
>>> link=rs.get(url)
>>> im=Image.open(BytesIO(link.content))
>>> print(im.size)
(800, 800)
>>> type(im)
<class 'PIL.JpegImagePlugin.JpegImageFile'>
>>> im.save(r'D:\01.jpg')