sx = original_width/destination_width
sy = original_height/destination_height
if sx*original_height > destination_height:
s = sy
else:
s = sx
new_width = original_width*s
new_height = original_height*s
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more