-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Regression] Attachment sizes do not respect aspect ratios #20546
Comments
Also, why is everything |
hey @wreiske about the !important its a generated css, and we should not trust on these classes, they can (and will) change, and you cannot predict. more than that, for some time we had some issues by the generated order being 'unordered' so we used important to solve. nowadays maybe we could remove the btw I will provide a properly fix to that ( the image sizes) |
This is very similar to issue #20307 . I looked deeply into this issue, but wasn't able to fix it. I will report my findings as that maybe useful to solve this issue. The size of this image is - height: 4000 pixels and width is 1846 pixels as seen in screenshot below of image properties- But when this image is rendered the height and width is interchanged which results in weird aspect ratio. I logged the imageDimensions value in ImageAttachment.tsx and got the interchanged value - Also, one more thing to not is, when I try to upload this Image, image will be shown as inverted in filePicker, I don't know if this has to do something with this issue. This can be seen in screenshot below - To debug this issue I looked into FileUpload of client and server, sendFileMessage method from sendFileMessage.js file, rooms.upload api call in rooms.js (here sendFileMessage method is called to save file to db). After looking into all these files and related files to these I am still not able to fix this issue. It would be very helpful @ggazzo if you can guide me in right direction for this issue. |
@yash-rajpal Can you send me the photo that causes that problem for some tests? I can't reproduce the issue... |
@tiagoevanp I have been trying to reproduce this issue on my mac and haven't been able to. The initial issue I reported while using the Windows client. Here's a way I was able to reproduce it on a mac using a gif image. |
@tiagoevanp I just checked again, now this image is uploaded correctly and dimensions of height and width are assigned correctly. |
Can confirm the error is still present, at least while previewing on the webclient. The image itself doesn't seem to be changed, it's only displayed with the wrong size on the webclient preview. |
As I see, the problem persists with gif images... Thanks for reply, I will find a solution for that asap. |
I still have the same problem with a jpg in Rocket.Chat V4.4 |
@D34DC3N73R Yep, that fixed it for me well enough. You're my hero! |
This is the latest that I'm using with RC 6.1.3. It gets rid of the space above and below gifs wider than a 1:1 aspect ratio.
|
Description:
The new attachment embeds do not respect the aspect ratio of images.
Steps to reproduce:
Expected behavior:
Actual behavior:
Server Setup Information:
Additional context
Changing width to max-width and height to max-height helps!
Rocket.Chat/client/components/Message/Attachments/context/AttachmentContext.tsx
Line 16 in 9b33bbe
Rocket.Chat/client/components/Message/Attachments/providers/AttachmentProvider.tsx
Line 20 in 0872682
Rocket.Chat/client/components/Message/Attachments/Files/ImageAttachment.tsx
Line 26 in fea272a
The text was updated successfully, but these errors were encountered: