Image resizing doesn't seem to be working

In Discourse 2.3.0.beta3 Release Notes we are told:

I’ve noticed recently that large images are displaying at full width, and the height is clipped.
For example:

Markup for that image is written as:

I’ve also tried
with the same full-width results.

When editing, the preview pane displays the image correctly:

1 Like

Yeah our tall image cropping is a very very confusing feature.

I have a fix proposed here.

@vinothkannans can you apply it, make sure tests pass and paste a bunch of examples here?


Does this mean there’s something I’m not understanding and doing wrong? And I don’t mean that to sound defensive, at all, simply that if it’s just that it’s confusing and I’ve not understood it, I’d love to know what I need to correct.


Large images are cropped based on the aspect ratio of the image as uploaded (there’s a setting called min ratio to crop that controls when they’re cropped)… this cropping applies even if the markdown dimensions fall below the cropping threshold.

So you’re not doing anything wrong other than being unaware of how the min ratio to crop threshold works (it would be a little crazy to expect everyone to understand that by simply looking at the image they’re about to upload, and the ratio setting is opaque to normal users!).

The fix being applied would ensure that the markdown dimensions are taken into consideration before cropping.


Not doing anything wrong. Just imagine a user uploaded an image that was 3 pixels wide and 50000 pixels tall. What would the topic look like, if that image was displayed in proportion? What if the user posted that image over and over? :thinking:


That reminds me, have been meaning to mention that super tall very narrow images really do screw up the Lightbox:

Those dimensions demonstrate it perfectly :wink:


Right, but imagine that without cropping for height!


Thanks! You nailed the “not understanding” part perfectly! :smile: