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.

「いいね!」 8

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

「いいね!」 1

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?

「いいね!」 5

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

「いいね!」 4

I really like the way RES handles this.

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

「いいね!」 3

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.

https://github.com/discourse/discourse/commit/667dd54a23b705d4286ac0b2a8d398c13675963b

「いいね!」 5

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?

「いいね!」 2

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

https://github.com/discourse/discourse/commit/32d253d484327e4880c1097d03747f0919edebcb

 

「いいね!」 10

Let’s see if it works!

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

「いいね!」 9

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:

https://github.com/discourse/discourse/commit/ebd4b4577168644ff1132af85215bfa2034ecdbb

「いいね!」 2