requests获取图片的宽和高

try:
if cover:
resp = requests.get('%s?x-oss-process=image/info' % (url), timeout=30)
if resp.status_code == 200:
rj = resp.json()
article_data['c_h'] = float(rj['ImageHeight']['value'])
article_data['c_w'] = float(rj['ImageWidth']['value'])
except Exception as e:
logger.info(e)
原文地址:https://www.cnblogs.com/quzq/p/10901622.html