I’ve just posted a new component and demo called ClippedImage which scales an image so that the bounding box of the component is always filled. The aspect ratio of the image will always be maintained. One dimension of the image will always extend to the edge of the bounding box rectangle and the other dimension will be clipped.
For instance, the width of an image will extend to the width of the bounding box. If the height of the image extends beyond the bounding box edge, it is clipped. If the rectangle changes size or shape and the image height becomes smaller than the bounding box edge, it will then be extended to the edge and the width dimension of the image will be clipped.
The image is clipped and scaled to fit, never stretched.