Merge branch 'krille/thumbnail-correct-scaling' into 'master'

Fix thumbnail scaling

See merge request famedly/famedlysdk!273
This commit is contained in:
Christian Pauly 2020-05-04 07:27:39 +00:00
commit 5afea11898

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;
} }