i've got the following example where I wish to resize an image using Pillow.
As you can see I have a new width being passed in by the user, but no height. How would I work out the new height for this image, whilst maintaining the same aspect ratio?
The images are not squares, they are rectangles, so the height and width wont be the same.
orig_image = Image.open(get_full_path(file.relative_path))
new_width = int(request.args.get('w'))
# TODO resize properly, we need to work out new image height
resized_image = orig_image.resize((new_width, ), Image.ANTIALIAS)