From 80f59c3006e0b832dd2e2140cc3ab7db6d5a6cf1 Mon Sep 17 00:00:00 2001 From: BongsoonChoi Date: Wed, 2 Jul 2025 12:21:29 +0900 Subject: [PATCH 1/4] thumbnail path update When the file path includes Korean characters, an error occurs. So, I used a try-catch block. --- lib/src/video_compress/video_compressor.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index 3b7b38e3..88f2425b 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -83,9 +83,16 @@ extension Compress on IVideoCompress { 'position': position, })); - final file = File(Uri.decodeFull(filePath!)); + String? decodedThumbnailPath; + if (filePath != null) { + try { + decodedThumbnailPath = Uri.decodeFull(filePath); + } catch (e) { + decodedThumbnailPath = filePath; + } + } - return file; + return File(decodedThumbnailPath); } /// get media information from [path] From da8faee2425bae6500ddf19f15940f7b151f691d Mon Sep 17 00:00:00 2001 From: BongsoonChoi Date: Wed, 2 Jul 2025 12:38:15 +0900 Subject: [PATCH 2/4] Update video_compressor.dart --- lib/src/video_compress/video_compressor.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index 88f2425b..a70f9ab3 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -92,7 +92,11 @@ extension Compress on IVideoCompress { } } - return File(decodedThumbnailPath); + if (decodedThumbnailPath != null) { + return File(decodedThumbnailPath!); + } else { + return File(filePath); + } } /// get media information from [path] From d4496f27e9683f9a50bb0c03bab4dc2df6155bcb Mon Sep 17 00:00:00 2001 From: BongsoonChoi Date: Wed, 2 Jul 2025 12:39:50 +0900 Subject: [PATCH 3/4] Update video_compressor.dart --- lib/src/video_compress/video_compressor.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index a70f9ab3..86029923 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -95,7 +95,7 @@ extension Compress on IVideoCompress { if (decodedThumbnailPath != null) { return File(decodedThumbnailPath!); } else { - return File(filePath); + return File(filePath!); } } From de66b489472435e158193d3390c206450e59fec7 Mon Sep 17 00:00:00 2001 From: BongsoonChoi Date: Wed, 2 Jul 2025 12:44:11 +0900 Subject: [PATCH 4/4] Update video_compressor.dart --- lib/src/video_compress/video_compressor.dart | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index 86029923..b6c86868 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -83,20 +83,13 @@ extension Compress on IVideoCompress { 'position': position, })); - String? decodedThumbnailPath; - if (filePath != null) { - try { - decodedThumbnailPath = Uri.decodeFull(filePath); - } catch (e) { - decodedThumbnailPath = filePath; - } - } - - if (decodedThumbnailPath != null) { - return File(decodedThumbnailPath!); - } else { - return File(filePath!); + String decodedThumbnailPath; + try { + decodedThumbnailPath = Uri.decodeFull(filePath!); + } catch (e) { + decodedThumbnailPath = filePath!; } + return File(decodedThumbnailPath); } /// get media information from [path]