From e1d46d929591b07653019f85f217bfa6496ec56d Mon Sep 17 00:00:00 2001 From: Thorben Nissen Date: Sat, 26 Oct 2019 19:39:04 +0200 Subject: [PATCH] [BUGFIX] Use original files width and height for ratio and max (#70) When calculating ratio, max width and height the original images data must be used to allow scaling images to their originals maximum size. --- Resources/Public/JavaScript/Plugins/typo3image.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Public/JavaScript/Plugins/typo3image.js b/Resources/Public/JavaScript/Plugins/typo3image.js index c26199d..ad548be 100644 --- a/Resources/Public/JavaScript/Plugins/typo3image.js +++ b/Resources/Public/JavaScript/Plugins/typo3image.js @@ -358,12 +358,12 @@ } }) } else if (config.type === 'number') { - var ratio = img.processed.width / img.processed.height; + var ratio = img.width / img.height; if (key === 'height') { ratio = 1 / ratio; } var opposite = 1; - var max = img.processed[key]; + var max = img[key]; var min = Math.ceil(opposite * ratio); $el.attr('max', max); $el.attr('min', min);