Only scale if width/height is positive

Fixes: #11728
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2021-02-09 16:23:44 +01:00
parent a37dbb57d6
commit 226aacdeac
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
1 changed files with 2 additions and 1 deletions

View File

@ -130,7 +130,8 @@
:height (* aspect-ratio max-width)})))
(defn link-preview-image [outgoing {:keys [height width] :as dimensions}]
(merge (if (and height width)
(merge (if (and (pos? height)
(pos? width))
(scale-dimensions dimensions)
{:height 170})
{:overflow :hidden