From d11b1917dcdf96226806dbb1dd8682c8f5647fc8 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Tue, 21 Sep 2021 20:32:51 -0400 Subject: [PATCH] featherlight js: Handle very wide aspect images --- templates/mark1/assets/js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/mark1/assets/js/scripts.js b/templates/mark1/assets/js/scripts.js index 0346063d..33640f8f 100644 --- a/templates/mark1/assets/js/scripts.js +++ b/templates/mark1/assets/js/scripts.js @@ -247,8 +247,8 @@ $(document).ready(function(){ if (ratio > 1) { /* Round ratio down so height calc works */ ratio = h / Math.floor(h / ratio); - /* Account for caption size */ - if (height + (caption_height * 2) > parent_height){ + /* Account for caption size, except short images */ + if (height > 300 && height + (caption_height * 2) > parent_height){ caption_factor = caption_factor - (caption_height * 2.5 / parent_height); } new_width = w * caption_factor / ratio;