Long picture adaptation

:information_source: Summary Stretching images with an aspect ratio greater than 2:1
:hammer_and_wrench: Repository GitHub - Lhcfl/discourse-larger-long-image
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Discourse often scales images to a suitable size and puts them into beautiful lightboxes. But this becomes a side effect on the sometimes long images that can appear. The long image is stretched into a slim 41x500 px² strip.

This theme component will apply stretching to images with an aspect ratio greater than 2:1 so that they fill the width of the post.

Effect

before

after

10 Likes

This is awesome, nice code work. Thanks for doing this :slight_smile:

2 Likes

The advantage of posting to github even for a simple theme is that

  • people don’t have to create a theme and paste the stuff in.
  • there is documentation where it came from
  • if changes are needed, they can be made in one place for everyone who needs the theme
10 Likes

You’re right. I’ll make it a GitHub repo when I back home.

8 Likes