chore: Adjust image and thumbnail compression

This commit is contained in:
Krille Fear 2021-11-26 16:12:52 +01:00
commit 8f47ad654d
3 changed files with 38 additions and 22 deletions

View file

@ -29,16 +29,12 @@ extension RoomSendFileExtension on Room {
bool waitUntilSent,
}) async {
MatrixFile thumbnail;
try {
if (file is MatrixImageFile) {
thumbnail = await file.resizeImage();
if (file is MatrixImageFile) {
thumbnail = await file.resizeImage();
if (thumbnail.size > file.size ~/ 2) {
thumbnail = null;
}
if (thumbnail.size > file.size ~/ 2) {
thumbnail = null;
}
} catch (e) {
// send no thumbnail
}
return sendFileEvent(