python --获取图片宽高
from PIL import Image img = Image.open(f'{BASE_DIR}/media/moren.jpg') width = img.size[0] # 宽 height = img.size[1] # 高 print(width) print(height) print(img.format) # 图片后缀