Skip to content

Commit

Permalink
[BUGFIX] Use original files width and height for ratio and max (#70)
Browse files Browse the repository at this point in the history
When calculating ratio, max width and height the original images data
must be used to allow scaling images to their originals maximum size.
  • Loading branch information
thommyhh authored and muh-nr committed Oct 26, 2019
1 parent 743e5ba commit e1d46d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Resources/Public/JavaScript/Plugins/typo3image.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e1d46d9

Please sign in to comment.