title: how to resize an image to a fit within max width and max height?
body: <p>I have a CI image upload form, and I want to make sure the images I upload will fit in a given rectangle. If they are too big - I want to downsize them. If they fit within that rectangle - I don't need resizing.</p>
  
  <p>I know CI supports max-height and max-width (as a limitation on how big the uploaded images can be), and it supports resize, but I couldn't find how to resize the image to a set max-height and max-width (while maintining the ratio).</p>