pythonresize
w = float( originWidth ) #原始宽度 h = float( originheight ) #原始高度 boxW = 260.0 #限制高度 boxH = 260.0 #限制宽度 if boxW / boxH >= w / h : w = round(boxH * w / h) h = boxH else: w = boxW h = round(boxW * h / w)