Only scale image bigger than 512px (#731)
This commit is contained in:
@@ -166,6 +166,9 @@ export function scaleDownImage(imageFile, width, height) {
|
||||
img.onload = () => {
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
if (newHeight <= height && newWidth <= width) {
|
||||
resolve(imageFile);
|
||||
}
|
||||
|
||||
if (newHeight > height) {
|
||||
newWidth = Math.floor(newWidth * (height / newHeight));
|
||||
|
||||
Reference in New Issue
Block a user