From 9faab229218cb218a1db2a7aed0d1d29ce6ed26c Mon Sep 17 00:00:00 2001 From: MinhDV Date: Thu, 28 Sep 2023 12:22:01 +0700 Subject: [PATCH] fix: send video dimensions on web --- lib/presentation/extensions/send_file_web_extension.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/presentation/extensions/send_file_web_extension.dart b/lib/presentation/extensions/send_file_web_extension.dart index fa5e4a8149..9ea2859021 100644 --- a/lib/presentation/extensions/send_file_web_extension.dart +++ b/lib/presentation/extensions/send_file_web_extension.dart @@ -163,6 +163,7 @@ extension SendFileWebExtension on Room { 'hashes': {'sha256': encryptedFile.sha256} }, 'info': { + ...thumbnail?.info ?? {}, ...file.info, if (thumbnail != null && encryptedThumbnail == null) 'thumbnail_url': thumbnailUploadResp.toString(), @@ -182,8 +183,6 @@ extension SendFileWebExtension on Room { 'hashes': {'sha256': encryptedThumbnail.sha256}, }, if (thumbnail != null) 'thumbnail_info': thumbnail.info, - if (thumbnail?.blurhash != null) - 'xyz.amorgan.blurhash': thumbnail?.blurhash, if (duration != null) 'duration': duration, }, if (extraContent != null) ...extraContent, @@ -302,6 +301,7 @@ extension SendFileWebExtension on Room { imageFormat: ImageFormat.JPEG, quality: AppConfig.thumbnailQuality, ); + final thumbnailBitmap = await convertUint8ListToBitmap(result); final blurHash = await runBenchmarked( '_generateBlurHash', () => _generateBlurHash(result), @@ -311,8 +311,8 @@ extension SendFileWebExtension on Room { bytes: result, name: originalFile.name, mimeType: originalFile.mimeType, - width: originalFile.width, - height: originalFile.height, + width: thumbnailBitmap?.width, + height: thumbnailBitmap?.height, blurhash: blurHash, ); } catch (e) {