RocketChat / RocketChat/Rocket.Chat

[Regression] Attachment sizes do not respect aspect ratios

Open
#20,546 21 comments 8 reactions 2 assignees View on GitHub

@tiagoevanp is already working on this.

Since Feb 8, 2021.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

The new attachment embeds do not respect the aspect ratio of images.

Steps to reproduce:
  1. Upload an image that is taller than it is wide
  2. Boom
Expected behavior:

image

Actual behavior:

image

Server Setup Information:
  • Version of Rocket.Chat Server: 3.11.0
  • Operating System:
  • Deployment Method:
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
Additional context

Changing width to max-width and height to max-height helps!

image

https://github.com/RocketChat/Rocket.Chat/blob/9b33bbe5d01fca435a52c2698a0a5409c3b0b7e7/client/components/Message/Attachments/context/AttachmentContext.tsx#L16
https://github.com/RocketChat/Rocket.Chat/blob/0872682d4c44d2aef20d24b87fc8fdd6d60bd639/client/components/Message/Attachments/providers/AttachmentProvider.tsx#L20
https://github.com/RocketChat/Rocket.Chat/blob/fea272a62b9c6bff9e7baccb8e10a355c3f47731/client/components/Message/Attachments/Files/ImageAttachment.tsx#L26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.