I am having trouble fitting a general `img` inside a responsive `div`.

My restrictions are:

1. Maintain the aspect ratio of the `img`
2. The `img` must cover all `div`, i.e. both `height` and `width` must be greater than `100%`
3. The size of the`img` must be as minimum as possible, i.e. `height=100%` or `width=100%`
4. The `img` should be centered in relation to the `div`

In other words I want to fit an image inside a container in such a way that I won't distort it and I will totally cover the container, while showing most of the image and keeping it centered.

If it simplifies I know that my `img` is always bigger than my `div`

All solutions encountered only satisfied a subset of the conditions