Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix size of portrait images with the SIZE_NORMAL setting. #7188

Merged
merged 3 commits into from
Nov 29, 2021

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented Nov 23, 2021

With this change, portrait images are drawn with the same width than Landscape images.
This was the requested behavior from design..
This PR #7171 fixed a bug for really high images but also made portrait images not behave as desired anymore.
(see the comments in the changed files for the logic used to determine image sizes)
Left old, right new (for the large setting nothing changes)
image


This change is marked as an internal change (Task), so will not be included in the changelog.

Preview: https://619f6fe0dafa3d153dcf4a2f--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

now portrait images are drawn with the same width than landsape images.
@toger5 toger5 requested a review from a team as a code owner November 23, 2021 12:01
@toger5 toger5 added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Nov 23, 2021
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks fine, though I'm a bit sad to see portrait images taking up even more space again - it feels like it defeats the purpose of the smaller image size setting.

src/settings/enums/ImageSize.ts Show resolved Hide resolved
src/settings/enums/ImageSize.ts Show resolved Hide resolved
@toger5 toger5 changed the title Make portrait images (up to 9:19) the same width than landscape in for SIZE_NORMAL setting. Make portrait images (up to 9:16) the same width than landscape in for SIZE_NORMAL setting. Nov 24, 2021
Copy link

@gaelledel gaelledel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@toger5 I'm sorry, there must have been a misunderstanding with this. My original request was to simply make sure that we have a set width for landscape and a set width for portrait whether it is image or video based media.

@toger5
Copy link
Contributor Author

toger5 commented Nov 25, 2021

I revisited this PR and added another default value for portrait images. They are handled the same way (they are sized so that the width fits the requested width, EXCEPT if the height exceeds a maximum) but just use different default values now.

  • this makes sure 16:9 images and 9:16 images take the same area in the timeline.
  • for images with an aspect ration lesser than 1:1 it introduces a new width so that the timeline is less chaotic.

left old, right new

Copy link

@gaelledel gaelledel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you very much @toger5!

@toger5 toger5 changed the title Make portrait images (up to 9:16) the same width than landscape in for SIZE_NORMAL setting. Fix size of portrait images with the SIZE_NORMAL setting. Nov 29, 2021
@toger5 toger5 merged commit 8860916 into develop Nov 29, 2021
@toger5 toger5 deleted the toger5/image_size_portrait branch November 29, 2021 14:01
Palid pushed a commit that referenced this pull request Nov 30, 2021
…om-alias

* origin/develop: (118 commits)
  Allow filtering room list during treeview navigation (#7219)
  Improve room list message previews (#7224)
  Fix EmojiPicker lazy loaded rendering bug (#7225)
  Prevent default avatar in UserInfo having pointer cursor (#7218)
  Hide scrollbar if content height is smaller than scroll node height (#7220)
  Add option to disable grouping in TimelinePanel (#7221)
  Prevent duplicate avatars in Event List Summaries (#7222)
  Add right panel chat timeline (#7112)
  Task/colors 12 (reorganize theme files again) (#7212)
  Fix size of portrait images with the SIZE_NORMAL setting. (#7188)
  Task/colors 11 (#7211)
  Respect the home page as a context for the Home space (#7216)
  Fix RoomUpgradeWarningBar exploding (#7214)
  Hide server options hint when disable_custom_urls is true (#7215)
  Polish threads misalignments and UI diversion (#7209)
  Improve right panel resize handle usability (#7204)
  Fix multiline paragraph rendering as single line (#7210)
  Fix Manage Restricted Join Rule Dialog for Spaces (#7208)
  Spaces quick settings (#7196)
  re-enable Spaces e2e tests (#7207)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants