From f6dc144af9b7eb7c3a9fd86175c00d3f419fa03f Mon Sep 17 00:00:00 2001 From: Greg Price Date: Tue, 16 Jul 2024 21:17:42 -0700 Subject: [PATCH] content: Use `object-fit: scale-down` to fit images, vs. `contain` This matches the behavior of Zulip web. The meaning of this value is that the image is either scaled according to `contain`, or not scaled at all, whichever makes it smaller. In other words, we still scale down all the images we were scaling down, but we stop scaling any images up, which tended to look a bit silly. If the user wants to see the image scaled up, they can always tap to see it in the lightbox. This case is about to become more common with the advent of thumbnailing: when we get a message where the server hasn't yet gotten to producing a thumbnail, we'll show a placeholder image. That placeholder is a 30x30 SVG, which looks rather odder if scaled up to 160px high. --- src/webview/static/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webview/static/base.css b/src/webview/static/base.css index 673b8c369c6..8988fd039e8 100644 --- a/src/webview/static/base.css +++ b/src/webview/static/base.css @@ -550,7 +550,7 @@ time { .twitter-image img { width: 100%; height: 160px; - object-fit: contain; + object-fit: scale-down; } .message_inline_video {