jQuery imgFitter Plugin Demo
Original
<img src="https://unsplash.it/800/600?image=0">
Square (400 x 300 cropped)
<img data-src="https://unsplash.it/800/600?image=0" class="img-fitter" width="400" height="300">
Horizon to Vertical (150 x 200 cropped)
<img data-src="https://unsplash.it/800/600?image=0" class="img-fitter" width="150" height="200">
Horizon to much Horizon (200 x 80 cropped)
<img data-src="https://unsplash.it/800/600?image=0" class="img-fitter" width="200" height="80">