title: How to resize an image in sharp with the option 'contain' but preserve the aspect ratio of the original dimensions?
body: <p>I have a 1000px by 750px image.</p>
  
  <p>I use lovell/sharp to resize it:</p>
  
  <pre><code>await sharp(image)
      .resize({
          fit: sharp.fit.contain,
          width: 800,
          height: 800
      })
      .jpeg({ quality: 80 })
      .toBuffer()
  </code></pre>
  
  <p>This results in a new image that is 800px by 800px, with the original image 'contained' inside of that region.</p>
  
  <p>What I would really like is to have a final image that is 800px by 600px.  IOW, to resize the image and preserve the aspect ratio.</p>
  
  <p>I realize it is possible to do this by specifying only a width.  However it is useful to have a bounding box to contain the resized image in, to avoid creating images greater than a certain height.</p>
  
  <p>Can I do this in sharp with different settings?</p>