Hi I want to achieve the following :
- Crop an image to a desired aspect ratio (lets say 2:1)
- Then let it resize automatically to fit into a box.
I want cropping because I have many boxes(divs) of fixed ratio(2:1). If I don't crop to desired aspect-ratio, then images will expand or shrink to fit into the box. The other solution to this problem is letter-boxing the image which again I don't want.
Can someone point out a solution to this.
For eg : If image is 100px X 100px, I first want to crop it to 66px X 33 px and then allow it to expand, shrink to fit my box all of which are 2:1.