Fix scaled resizing
This commit is contained in:
parent
2f0a1dce3c
commit
91210205bc
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue