[Answer]-Python 2 / Pillow – issue calculating resized image height & width

1👍

In Python 3, / uses floating-point arithmetic when necessary. In Python 2, you have to specify floats. Change:

(w/h) * 400

to

(float(w)/h) * 400

and similar, wherever necessary.

Leave a comment