First post for me here.
I\'m using a div to crop thumbnail images all in the same proportions (180wx170h). I\'m getting stuck when dealing with portrait as well as land
You could try
.crop img {max-height:170px; max-width:180px;}
Since max-height and max-width are maxima, it should work. The browser will make the image as big as possible, without going over your dimensions.
max-height
max-width
Note that this is untested, but based on this W3Schools page.
Hope this helps!!