Long picture adaptation

AI-generated summary

The Long picture adaptation theme component addresses the issue of long images being stretched into slim strips on Discourse. The component applies stretching to images with an aspect ratio greater than 2:1, allowing them to fill the width of the post.

Lhc_fl provides a repository for the theme component, along with installation instructions. The component can be installed using the automatic install button.

Lilly praises the code work, while pfaffman highlights the benefits of hosting the theme on GitHub, including easy updates and documentation. Lhc_fl intends to migrate the theme to a GitHub repository.

:information_source: Summary Stretching images with an aspect ratio greater than 2:1
:hammer_and_wrench: Repository GitHub - Lhcfl/discourse-larger-long-image · GitHub
: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

13 Likes

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

3 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
13 Likes

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

9 Likes