mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
fix: Pictures in stories use wrong shrink algo
This commit is contained in:
parent
42267f263e
commit
b786037e93
@ -73,16 +73,12 @@ class AddStoryController extends State<AddStoryPage> {
|
|||||||
);
|
);
|
||||||
final fileName = picked.fileName;
|
final fileName = picked.fileName;
|
||||||
if (fileName == null) return;
|
if (fileName == null) return;
|
||||||
final shrinked = await showFutureLoadingDialog(
|
final matrixFile = MatrixImageFile(
|
||||||
context: context,
|
|
||||||
future: () => MatrixImageFile.shrink(
|
|
||||||
bytes: picked.toUint8List(),
|
bytes: picked.toUint8List(),
|
||||||
name: fileName,
|
name: fileName,
|
||||||
compute: Matrix.of(context).client.runInBackground,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
image = shrinked.result;
|
image = matrixFile;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,19 +87,18 @@ class AddStoryController extends State<AddStoryPage> {
|
|||||||
source: ImageSource.camera,
|
source: ImageSource.camera,
|
||||||
);
|
);
|
||||||
if (picked == null) return;
|
if (picked == null) return;
|
||||||
final shrinked = await showFutureLoadingDialog(
|
final matrixFile = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () async {
|
||||||
final bytes = await picked.readAsBytes();
|
final bytes = await picked.readAsBytes();
|
||||||
return await MatrixImageFile.shrink(
|
return MatrixImageFile(
|
||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
name: picked.name,
|
name: picked.name,
|
||||||
compute: Matrix.of(context).client.runInBackground,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
image = shrinked.result;
|
image = matrixFile.result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user