Option to turn off tall image cropping

I have a feeling this wouldn’t be so easy.

Background images can have an object-fit property of contain

contain

The replaced content is scaled to maintain its aspect ratio while fitting within the element’s content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be “letterboxed” if its aspect ratio does not match the aspect ratio of the box.

But that isn’t for non-replaced images.

Although the raison d’être of Discourse is discussion and not an image gallery, I think this has come up often enough that a good Pull Request has a good chance of being considered. If not that, a plugin for those that wanted the option to either crop or resize images would get a few takers.

Have you been trying anything that has potential that you’re willing to share?