chore: Adjust image and thumbnail compression
This commit is contained in:
parent
0d1bb7103f
commit
8f47ad654d
3 changed files with 38 additions and 22 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue