Calculate the corners when cropping an image with a given ratio