Fix thumbnail scaling

This commit is contained in:
Christian Pauly 2020-05-04 09:22:44 +02:00
parent 0e3fabcef3
commit 2064f53c34

View file

@ -27,7 +27,13 @@ class MatrixFile {
} catch (_) { } catch (_) {
return false; return false;
} }
final resizedImage = copyResize(image, width: width, height: height); var resizedImage = image;
if (image.width > width) {
resizedImage = copyResize(image, width: width);
}
if (image.height > height) {
resizedImage = copyResize(image, height: height);
}
bytes = encodeJpg(resizedImage, quality: quality); bytes = encodeJpg(resizedImage, quality: quality);
return true; return true;
} }