element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
GNU Affero General Public License v3.0
432 stars 106 forks source link

Request: remove dead space from captioned images #3436

Open wrjlewis opened 1 month ago

wrjlewis commented 1 month ago

Screenshot 2024-10-22 at 12 33 45

Is your feature request related to a problem? Please describe. With captioned image support landing in EX iOS soon (in the dev builds currently), I've noticed there is a lot of grey empty space in the message bubble when the image is tall and thin with a caption.

Describe the solution you'd like I believe this is solved in other messengers by cropping the image so that it fits squarely in the bubble, but at the expense of cutting off the bottom of the image in the thumbnail.

For example, the same captioned image appears in WA like this: Screenshot 2024-10-22 at 12 43 52

manuroe commented 1 month ago

thanks @wrjlewis . This is very good point. We probably some logic about to handle such aspect ratios: a min image width with crop to fit and wrapping the text to input. We also need to manage very weird aspect ration like 10px x 1000px. cc @amshakal @pixlwave @bmarty

pixlwave commented 1 month ago

Seems worth adding that this is larger than media captions as we also have the case of replies/threads where the same happens.

Additionally, there's the edge case of small images to handle as we (generally) don't upscale images:

screenshot@2x