title: Pillow Resize Image - Maintaing Aspect Ratio
body: <p>i've got the following example where I wish to resize an image using Pillow.</p>
  <p>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?</p>
  <p>The images are not squares, they are rectangles, so the height and width wont be the same.</p>
  <pre><code>    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)
  </code></pre>