From 2b2ac8ff55fd2d587fb550a7b4745477fa8a435d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Cerezo?= <104803561+joseenrique61@users.noreply.github.com> Date: Sun, 2 Nov 2025 22:01:02 -0500 Subject: [PATCH] Added file fusion to C2E (#1149) * Added file fusion to C2E * Updated README.md --- .gitignore | 1 + README.md | 1 + kindlecomicconverter/comic2ebook.py | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index d6094c9..0f952a0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ dist/ build/ KindleComicConverter*.egg-info/ .idea/ +.vscode/ win7 osx10.11 /venv/ diff --git a/README.md b/README.md index 09d089b..58d39f8 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,7 @@ OUTPUT SETTINGS: --spreadshift Shift first page to opposite side in landscape for two page spread alignment --norotate Do not rotate double page spreads in spread splitter option. --rotatefirst Put rotated spread first in spread splitter option. + --filefusion Combines all input files into a single file. --eraserainbow Erase rainbow effect on color eink screen by attenuating interfering frequencies CUSTOM PROFILE: diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index ccfbb7e..7f2e513 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -71,12 +71,23 @@ def main(argv=None): if len(sources) == 0: print('No matching files found.') return 1 + if options.filefusion: + fusion_path = makeFusion(list(sources)) + sources.clear() + sources.add(fusion_path) for source in sources: source = source.rstrip('\\').rstrip('/') options = copy(args) options = checkOptions(options) print('Working on ' + source + '...') makeBook(source) + + if options.filefusion: + for path in sources: + if os.path.isfile(path): + os.remove(path) + elif os.path.isdir(path): + rmtree(path, True) return 0 @@ -1330,6 +1341,8 @@ def makeParser(): help="Disable autocontrast.") output_options.add_argument("--colorautocontrast", action="store_true", dest="colorautocontrast", default=False, help="Autocontrast color pages too. Skipped for pages without near blacks or whites.") + output_options.add_argument("--filefusion", action="store_true", dest="filefusion", default=False, + help="Combines all input files into a single file.") processing_options.add_argument("-c", "--cropping", type=int, dest="cropping", default="2", help="Set cropping mode. 0: Disabled 1: Margins 2: Margins + page numbers [Default=2]") processing_options.add_argument("--cp", "--croppingpower", type=float, dest="croppingp", default="1.0",