Image that dynamically fills container, keeping aspect ratio
It sounds so simple,
Image should be resized down to fit the size of its parent
Image shouldn't be stretched larger than its original dimensions
Image should still exist in document flow, no position: absolute
Aspect ratio must be preserved
So, I wrote my own, from scratch.
I'm using this code to show a gallery for the digital art I've been working on.