From c28ea9ce556f6c32a32bc483c22378fb3fea712d Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 7 Jan 2022 11:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/release_dynamic.dart | 2 +- lib/retrofit/retrofit_api.g.dart | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 7e649ea8..cacbb575 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -186,7 +186,7 @@ class _ReleaseDynamic extends State { } else { thumbnail = await Thumbnails.getThumbnail( videoFile: file.path, - imageType: ThumbFormat.WEBP, + imageType: ThumbFormat.JPEG, quality: 10, ); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 9dee0b09..70952c93 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -23,11 +23,14 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = FormData(); + String fileName = data.path.split(Platform.pathSeparator).last; + if(!fileName.contains(".jpeg")) + fileName += ".jpeg"; _data.files.add(MapEntry( 'file', MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); - print("filename:${data.path}"); + filename: fileName))); + print("filename:$fileName"); if (folderId != null) { _data.fields.add(MapEntry('folderId', folderId.toString())); }