Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

Link preview should not enlarge small images

Open paulchen opened this issue 2 years ago • 1 comments

Description:

When a user creates a message containing a link to an image, the app shows a preview of that image. The preview is resized in order for its width to match the width available for the message content. While this works fine for large images, (very) small images get enlarged by enormous factors.

Environment Information:

  • Rocket.Chat Server Version: 6.5.3
  • Rocket.Chat App Version: 4.45.0.55377
  • Device Name: ELE-L29 (Huawei P30)
  • OS Version: EMUI 12.0.0 (Android 11)

Steps to reproduce:

  1. Write a message containing a link to a very small image, e.g. https://rueckgr.at/~paulchen/avatar-small.png (24x24 px).

Expected behavior:

The image is not unnecessarily enlarged for the link preview. This is how it looks like in a desktop browser:

image

And in the mobile browser:

image

Actual behavior:

image

paulchen avatar Jan 23 '24 21:01 paulchen

Hey @diegolmello, should I start working on this issue?

preeesha avatar Feb 09 '24 18:02 preeesha

@paulchen can you provide more context? about this issue

JASIM0021 avatar Jul 12 '24 18:07 JASIM0021

@paulchen can you provide more context? about this issue

@JASIM0021 I don't know what information to provide besides what is already given above. If you have specific questions, feel free to ask.

paulchen avatar Jul 12 '24 22:07 paulchen

@paulchen more information meaning is this problem occurring in both device ( android + ios ) or any device specific issue

let me confirm is this issue getting on both device or not

JASIM0021 avatar Jul 13 '24 10:07 JASIM0021

@paulchen i am working on it

JASIM0021 avatar Jul 13 '24 10:07 JASIM0021

@paulchen more information meaning is this problem occurring in both device ( android + ios ) or any device specific issue

@JASIM0021 I don't have access to an iOS device, therefore I am unable to answer this particular question.

However, I just verified that it still occurs on Android (Pixel 8, Android 14, build number AP2A.240705.005, app version 4.50.1.63100):

share_5789104652857057707

paulchen avatar Jul 13 '24 17:07 paulchen

@paulchen this problem has been fixed on both devices please review pr:- https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/5789

JASIM0021 avatar Jul 14 '24 03:07 JASIM0021