diff --git a/README.md b/README.md
index c0afe7ad..a3e3376d 100644
--- a/README.md
+++ b/README.md
@@ -287,6 +287,7 @@ PROCESSING:
--pdfwidth Render vector PDFs based on device width instead of height.
-u, --upscale Resize images smaller than device's resolution
-s, --stretch Stretch images to device's resolution
+ --wallpaper Crop images to to fill screen
-r SPLITTER, --splitter SPLITTER
Double page parsing mode. 0: Split 1: Rotate 2: Both [Default=0]
-g GAMMA, --gamma GAMMA
diff --git a/gui/KCC.ui b/gui/KCC.ui
index 2b31b6d2..514afec2 100644
--- a/gui/KCC.ui
+++ b/gui/KCC.ui
@@ -693,6 +693,18 @@ Keeping this file may crash some readers like the Kobo native CBZ reader.
+
Shift+Click to edit directory.
", None)) #endif // QT_CONFIG(tooltip) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 5c47c28a..9ff38643 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1058,7 +1058,7 @@ def getWorkFolder(afile, options, workdir=None): def getOutputFilename(srcpath, wantedname, ext, tomenumber): - if options.format == 'CBZ' and options.skip_zip: + if options.folder_output: ext = '' source_path = Path(srcpath) if srcpath[-1] == os.path.sep: @@ -1071,7 +1071,7 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber): ext = '.kepub.epub' if wantedname is not None: wanted_root, wanted_ext = os.path.splitext(wantedname) - if wantedname.endswith(ext): + if not options.folder_output and wantedname.endswith(ext): filename = os.path.abspath(wantedname) elif wanted_ext == '.mobi' and ext == '.epub': filename = os.path.abspath(wanted_root + ext) @@ -1432,8 +1432,8 @@ def slugify(value, options, is_natural_sorted): return value def makeZIP(zipfilename, basedir, job_progress='', isepub=False): - if options.format == 'CBZ' and options.skip_zip: - os.rename(basedir, zipfilename) + if options.folder_output: + move(basedir, zipfilename) return zipfilename start = perf_counter() if SEVENZIP in available_archive_tools(): @@ -1480,6 +1480,8 @@ def makeParser(): help="Manga style (right-to-left reading and splitting)") main_options.add_argument("--lightnovel", action="store_true", dest="lightnovel", default=False, help="Only resize images and preserve original file structure.") + main_options.add_argument("--wallpaper", action="store_true", dest="wallpaper", default=False, + help="Crop to fill screen.") main_options.add_argument("--ebok", action="store_true", dest="ebok", default=False, help="Force EBOK tag instead of PDOC for MOBI") main_options.add_argument("--invertdirection", action="store_true", dest="invertdirection", default=False, @@ -1645,9 +1647,11 @@ def checkOptions(options): options.format = 'MOBI' options.kfx = False options.skip_zip = False + options.folder_output = False if options.format == 'FOLDER': options.format = 'CBZ' options.skip_zip = True + options.folder_output = True if options.format == 'Auto': if options.profile in ['KDX']: options.format = 'CBZ' diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py index bd680e43..bc50038f 100755 --- a/kindlecomicconverter/image.py +++ b/kindlecomicconverter/image.py @@ -513,7 +513,9 @@ class ComicPage: self.image = erase_rainbow_artifacts(self.image, is_color) def resizeImage(self): - if self.opt.norotate and self.targetPathOrder in ('-kcc-a', '-kcc-d') and not self.opt.kindle_scribe_azw3: + if self.opt.wallpaper: + pass + elif self.opt.norotate and self.targetPathOrder in ('-kcc-a', '-kcc-d') and not self.opt.kindle_scribe_azw3: # TODO: Kindle Scribe case if self.opt.kindle_azw3 and any(dim > 1920 for dim in self.image.size): self.image = ImageOps.contain(self.image, (1920, 1920), Image.Resampling.LANCZOS) @@ -536,6 +538,8 @@ class ComicPage: self.image = ImageOps.pad(self.image, self.opt.kfx_resolution, method=method, color=self.fill) elif self.opt.stretch: self.image = self.image.resize(self.size, method) + elif self.opt.wallpaper: + self.image = ImageOps.fit(self.image, self.size, method=method) elif method == Image.Resampling.BICUBIC and not self.opt.upscale: pass else: # if image bigger than device resolution or smaller with upscaling