From 2408096a7c50ad3e9aaca1c11a82c4c99ee010ea Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 24 Nov 2024 12:53:06 +0800 Subject: [PATCH] fix cbz export --- lib/utils/cbz.dart | 2 +- lib/utils/io.dart | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/utils/cbz.dart b/lib/utils/cbz.dart index a2458f2..35a9fd6 100644 --- a/lib/utils/cbz.dart +++ b/lib/utils/cbz.dart @@ -187,7 +187,7 @@ abstract class CBZ { } int i = 1; for (var image in allImages) { - var src = File(image.replaceFirst('file://', '')); + var src = openFilePlatform(image); var width = allImages.length.toString().length; var dstName = '${i.toString().padLeft(width, '0')}.${image.split('.').last}'; diff --git a/lib/utils/io.dart b/lib/utils/io.dart index 50ef88a..9df3d29 100644 --- a/lib/utils/io.dart +++ b/lib/utils/io.dart @@ -324,6 +324,9 @@ Directory openDirectoryPlatform(String path) { } File openFilePlatform(String path) { + if(path.startsWith("file://")) { + path = path.substring(7); + } if(App.isAndroid) { var f = AndroidFile.fromPathSync(path); if(f == null) {