refactor: Use image package to resize images

This commit is contained in:
Krille Fear 2021-11-20 16:54:18 +01:00
commit b44f309151
8 changed files with 61 additions and 145 deletions

View file

@ -26,12 +26,11 @@ class _SendFileDialogState extends State<SendFileDialog> {
bool origImage = false;
bool _isSending = false;
static const maxWidth = 1600;
Future<void> _send() async {
var file = widget.file;
if (file is MatrixImageFile && !origImage) {
try {
file = await resizeImage(file, max: maxWidth);
file = await file.resizeImage();
} catch (e) {
// couldn't resize
}