From 81cd9b2082b180bf874202702df8e4e94440d048 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 21 Aug 2025 02:22:21 +0800 Subject: [PATCH] :bug: Fix issues when saving image to gallery without ext name --- lib/widgets/content/cloud_file_collection.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/widgets/content/cloud_file_collection.dart b/lib/widgets/content/cloud_file_collection.dart index 936bdb2b..94271738 100644 --- a/lib/widgets/content/cloud_file_collection.dart +++ b/lib/widgets/content/cloud_file_collection.dart @@ -326,7 +326,11 @@ class CloudFileZoomIn extends HookConsumerWidget { // Create a temporary file to save the image final tempDir = await getTemporaryDirectory(); - final filePath = '${tempDir.path}/${item.id}.${extension(item.name)}'; + var extName = extension(item.name).trim(); + if (extName.isEmpty) { + extName = item.mimeType?.split('/').lastOrNull ?? 'jpeg'; + } + final filePath = '${tempDir.path}/${item.id}.$extName'; await client.download( '/drive/files/${item.id}',