RocketChat / RocketChat/Rocket.Chat
[Regression] Attachment sizes do not respect aspect ratios
@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:
- Upload an image that is taller than it is wide
- Boom
Expected behavior:

Actual behavior:

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!

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.