From b786037e93c9b30725253c0e69c155d611947a97 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 28 Apr 2022 19:21:06 +0200 Subject: [PATCH] fix: Pictures in stories use wrong shrink algo --- lib/pages/add_story/add_story.dart | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/pages/add_story/add_story.dart b/lib/pages/add_story/add_story.dart index 58136f4e..5a875e53 100644 --- a/lib/pages/add_story/add_story.dart +++ b/lib/pages/add_story/add_story.dart @@ -73,16 +73,12 @@ class AddStoryController extends State { ); final fileName = picked.fileName; if (fileName == null) return; - final shrinked = await showFutureLoadingDialog( - context: context, - future: () => MatrixImageFile.shrink( - bytes: picked.toUint8List(), - name: fileName, - compute: Matrix.of(context).client.runInBackground, - ), + final matrixFile = MatrixImageFile( + bytes: picked.toUint8List(), + name: fileName, ); setState(() { - image = shrinked.result; + image = matrixFile; }); } @@ -91,19 +87,18 @@ class AddStoryController extends State { source: ImageSource.camera, ); if (picked == null) return; - final shrinked = await showFutureLoadingDialog( + final matrixFile = await showFutureLoadingDialog( context: context, future: () async { final bytes = await picked.readAsBytes(); - return await MatrixImageFile.shrink( + return MatrixImageFile( bytes: bytes, name: picked.name, - compute: Matrix.of(context).client.runInBackground, ); }); setState(() { - image = shrinked.result; + image = matrixFile.result; }); }