Skip to content

Appropriate limit to image width/size #19869

Open

Description

@HarHarLinks

Your use case

What would you like to do?

Images can have many aspect ratios. Recently this setting was added to element (matrix-org/matrix-react-sdk#7017):
image
I like that feature very much for most use cases, for example: often a smartphone screenshot is shared with a 9:16 or similar ratio at resolutions of 1080x1920. That is huge and fills out the whole screen.

On the other hand, sometimes I share screenshots like the following:
image
image

I would like there to be a threshold of aspect ratio where element displays the thumbnail still at max width (as it used to), but as the aspect ratio gets closer to square, limit it (by height, e.g. as high as a collapsed code block?).

Why would you like to do it?

There is no use in limiting pictures like these to 1/3 of the timeline width (on 1080p, with right panel open), actually it limits the usefulness as I can barely recognize what the thumbnail is of.

How would you like to achieve it?

I think it is more complicated than simply limiting height. In the end an image should take up a maximum amount of display area. There is a threshold somewhere in there where an image starts to feel overwhelmingly large.

Have you considered any alternatives?

No response

Additional context

#19788

Activity

  1. added
    O-OccasionalAffects or can be seen by some users regularly or most users rarely
    on Nov 24, 2021
  2. HarHarLinks commented on Jan 21, 2022

    @HarHarLinks
    ContributorAuthor

    image

    This case is so ridiculous, I thought it was a <hline>/--- for a second.

  3. added
    S-MajorSeverely degrades major functionality or product features, with no satisfactory workaround
    on Feb 8, 2022
  4. HarHarLinks commented on Feb 8, 2022

    @HarHarLinks
    ContributorAuthor

    image

    the timestamp (see on the left) can get overlapped: an element should be fixed to have minimum height of 1em ("one line of text") or so.

  5. weirdreality commented on Feb 25, 2026

    @weirdreality

    Images/videos in the timeline seem to be limited to a maximum width or height of 324 pixels on my 2560 pixel wide screen, which is jarringly small.

    On Discord with the same screen dimensions the maximum width is 550 pixels and height seems to be 350. Maybe something similar can be done where the (presumably calculated relative to the screen) maximum allowed width is higher than the maximum allowed height.

    Edit: Relevant code:

    const SIZE_NORMAL_LANDSCAPE = { w: 324, h: 324 }; // for w > h
    const SIZE_NORMAL_PORTRAIT = { w: Math.ceil(324 * (9 / 16)), h: 324 }; // for h > w

    Relevant commit 8860916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MediaO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MajorSeverely degrades major functionality or product features, with no satisfactory workaroundT-EnhancementX-Needs-Design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions