title: Finding the biggest centered square from a landscape or a portrait UIImage and scale it to a size
body: <p>I need to find the biggest centered square from a portrait or a landscape image scaled to a size.
  E.g. if I get an image of size 1200x800 and I need to get the centered square down to size 300x300.</p>