Skip to content

Commit

Permalink
fix: send video dimensions on web
Browse files Browse the repository at this point in the history
  • Loading branch information
drminh2807 authored and hoangdat committed Sep 28, 2023
1 parent c60a770 commit 9faab22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/presentation/extensions/send_file_web_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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,
Expand Down Expand Up @@ -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),
Expand All @@ -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) {
Expand Down

0 comments on commit 9faab22

Please sign in to comment.