from io import BytesIO,StringIO
import requests
from PIL import Image
img_url = "https://profile.csdnimg.cn/F/6/F/3_cyj5201314"
response = requests.get(img_url)
f = BytesIO(response.content)
img = Image.open(f)
print(img.size)
輸出如下:
(75, 75)
Process finished with exit code 0