It isn't complete yet, but I started to create this a while ago in response to two similar requests. Two other recent similar requests prompted me to continue the effort. It hotlinks the images which is not ideal but it is the only way (as far as I know) to get the effect you want without either using JS or requiring users to download-crop-upload separate versions of the images. The reason hotlinking isn't ideal is because the images are images are treated as external content. In addition to issues I probably haven't thought of, this means that the hotlinks don't count towards the image use counts. So, for example, if you use an image 20 times but all 20 instances are hotlinks, the image will still be shown in the database as unused.
So to clarify, I updated my template again to demonstrate the issue. So the top left triangel is using Template:Filepath while the bottom right triange is using [[File:]]. The problem [[File:]] is having is that for whatever reason, it does not scale the width when I changing the height. Template:Filepath does not have that problem. In the CSS, the wrapping div is set to 'height: 100%'. I'm not sure what the difference is between the two, so I'm trying to see if there is another way of adding a link to an image.