import:: doc:: 1from PIL import Image2 3img = Image.open(io.BytesIO(req_img))4 5width, height = img.size # 获取宽高