From 8bedd29f2126310e0318a38872e2b8eb0bab0df1 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 13 Sep 2019 11:00:52 +0000 Subject: [PATCH] [Thumbnails] Fix path --- lib/src/Room.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/Room.dart b/lib/src/Room.dart index c095c48..accfdde 100644 --- a/lib/src/Room.dart +++ b/lib/src/Room.dart @@ -276,7 +276,8 @@ class Room { } Future sendImageEvent(File file, {String txid = null}) async { - String fileName = file.path.split("/").last; + String path = file.path; + String fileName = path.split("/").last; Map info; // Try to manipulate the file size and create a thumbnail @@ -284,8 +285,8 @@ class Room { Image image = copyResize(decodeImage(file.readAsBytesSync()), width: 800); Image thumbnail = copyResize(image, width: 236); - file = File(fileName)..writeAsBytesSync(encodePng(image)); - File thumbnailFile = File(fileName) + file = File(path)..writeAsBytesSync(encodePng(image)); + File thumbnailFile = File(path) ..writeAsBytesSync(encodePng(thumbnail)); final dynamic uploadThumbnailResp = await client.connection.upload(thumbnailFile);