Fix scaled resizing

This commit is contained in:
Jonathan Cremin 2016-06-06 17:34:04 +01:00
parent 2f0a1dce3c
commit 91210205bc

View file

@ -58,10 +58,11 @@ function scale(path, type, size) {
export default function resize(path, type, currentSize, newSize) {
debug('Resizing');
const ratio = 970 / currentSize.width;
debug(newSize.width, ratio);
if (newSize.width <= 150) {
debug('Cover');
return cover(path, type, newSize);
} else if (newSize.width > 970 && ratio > 1) {
} else if (newSize.width >= 970 && ratio < 1) {
debug('Scale');
newSize.height = currentSize.height * ratio; // eslint-disable-line no-param-reassign
return scale(path, type, newSize);