title: resize and crop image centered
body: <p>so currently i'm trying to crop and resize a picture to fit it into a specific size without losing the ratio.</p>
  
  <p>a small image to show what i mean:</p>
  
  <p><img src="https://i.stack.imgur.com/pxQI7.jpg" alt="alt text"></p>
  
  <p>i played a bit with <a href="http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/" rel="noreferrer">vocaro's categories</a> but they don't work with png's and have problems with gifs. also the image doesn't get cropped.</p>
  
  <p>does anyone have a suggestion how to do this resizing the best way or probably have a link to an existing library/categorie/whatever?</p>
  
  <p>thanks for all hints!</p>
  
  <p>p.s.:  does ios implement a "select a excerpt" so that i have the right ratio and only have to scale it?!</p>