Feature Request: Tall and Thin Image Handling

I think this is a feature request. We have users putting images in posts, and sometimes those images are quite tall, i.e. height much greater than the width. Discourse provides an image preview in the post, but uses the image height within the post height to determine the aspect ratio. An example image looks like this:

Ideally we’d like to present this image so that the image width takes the full post width, but perhaps shows a ‘More…’ link at the bottom. The ‘image viewer overlay’ (not sure what type, mfp css classes) struggles with this format too, in that it squishes the file info at the bottom.

So yep, probably a bit unusual but thought I’d throw that out there anyway. If anyone has any simple custom CSS then we could give that a go too.


we have the same problem-- I’d love to see this addressed

1 Like

I am also interested in this @zogstrip, I think we need special handling of very tall images. Maybe the thumbnail crops them at a certain height to prevent crazy super-mega-tall thumbnails with bizarre height to width ratios, as in, way too tall?


@zogstrip is working on this but it turned out to be harder than we expected. :muscle:


I really like the way RES handles this.

The comics at /r/polandball are a textbook example of such tall images.


Took me longer than anticipated because I went the wrong way trying to solve this. Left it on the backburner for a few days before going back to it with another approach :wink:

There’s now a new site setting: crop_tall_images which is enabled by default and will generate a crop of tall images instead of generating a thin thumbnail.



Why ever disable this? Does it really need a site setting? It seems like such a net positive that I can’t imagine it ever needing it to be disabled?


Might be a bit of imagineering on my part but there might be art/design/photo-heavy communities who might not want to crop their images and instead increased the maximum height.

It’s only 2 ifs so it’s an easy change if we need to remove it.

I know, 3 “might” in the same sentence is definitely leaning towards imageerining…

I suggest we wait for that request rather than adding another site setting Because We Can.

1 Like




Let’s see if it works!

Yes! Amazing! Well done @zogstrip :kiss: :flag_fr: :frog: :poodle:


Something’s not right in the top image of this post:

I’m confused now. Is this intended behaviour? I guess I’m clamouring for this now?

I’m actually tweaking the ratio used to trigger the crop. Will change it so that iPhone 6 screenshot don’t crop :wink: