From 160b535552c38d3da0182e5f2c35b5ce32d03982 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 29 Dec 2022 11:34:29 +0800 Subject: [PATCH] Not all cards work in large size Check the image aspect ratio before converting to large size --- src/components/status.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 037a51b3..c12889e7 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -861,7 +861,8 @@ function Card({ card, size }) { */ const hasText = title || providerName || authorName; - size = size === 'l' ? 'large' : ''; + const isLandscape = width / height >= 1.2; + size = size === 'l' && isLandscape ? 'large' : ''; if (hasText && image) { const domain = new URL(url).hostname.replace(/^www\./, '');