mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 09:46:25 +00:00
Fix spread splitter not keeping aspect ratio
This commit is contained in:
@@ -146,7 +146,7 @@ Options:
|
||||
Comic title [Default=filename or directory name]
|
||||
-f FORMAT, --format=FORMAT
|
||||
Output format (Available options: Auto, MOBI, EPUB,
|
||||
CBZ, KFX, MOBI+EPUB, KFX+EPUB) [Default=Auto]
|
||||
CBZ, KFX, MOBI+EPUB) [Default=Auto]
|
||||
-b BATCHSPLIT, --batchsplit=BATCHSPLIT
|
||||
Split output into multiple files. 0: Don't split 1:
|
||||
Automatic mode 2: Consider every subdirectory as
|
||||
|
||||
@@ -118,8 +118,6 @@ class Icons:
|
||||
self.KFXFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/KFX.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.MOBIEPUBFormat = QtGui.QIcon()
|
||||
self.MOBIEPUBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/MOBI.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.KFXEPUBFormat = QtGui.QIcon()
|
||||
self.KFXEPUBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/KFX.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.EPUB200MBFormat = QtGui.QIcon()
|
||||
self.EPUB200MBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/EPUB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
|
||||
@@ -1114,7 +1112,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
GUI.deviceBox.addItem(self.icons.deviceKobo, profile)
|
||||
else:
|
||||
GUI.deviceBox.addItem(self.icons.deviceKindle, profile)
|
||||
for f in ['MOBI/AZW3', 'EPUB', 'CBZ', 'KFX', 'MOBI+EPUB', 'KFX+EPUB', 'EPUB-200MB']:
|
||||
for f in ['MOBI/AZW3', 'EPUB', 'CBZ', 'KFX', 'MOBI+EPUB', 'EPUB-200MB']:
|
||||
format_prefix = f.replace('/AZW3', '').replace('+', '').replace('-', '')
|
||||
GUI.formatBox.addItem(eval('self.icons.' + format_prefix + 'Format'), f)
|
||||
if self.lastDevice > GUI.deviceBox.count():
|
||||
|
||||
@@ -931,7 +931,7 @@ def makeParser():
|
||||
outputOptions.add_option("-t", "--title", action="store", dest="title", default="defaulttitle",
|
||||
help="Comic title [Default=filename or directory name]")
|
||||
outputOptions.add_option("-f", "--format", action="store", dest="format", default="Auto",
|
||||
help="Output format (Available options: Auto, MOBI, EPUB, CBZ, KFX, MOBI+EPUB, KFX+EPUB) "
|
||||
help="Output format (Available options: Auto, MOBI, EPUB, CBZ, KFX, MOBI+EPUB) "
|
||||
"[Default=Auto]")
|
||||
outputOptions.add_option("-b", "--batchsplit", type="int", dest="batchsplit", default="0",
|
||||
help="Split output into multiple files. 0: Don't split 1: Automatic mode "
|
||||
@@ -992,9 +992,6 @@ def checkOptions(options):
|
||||
if options.format == 'MOBI+EPUB':
|
||||
options.keep_epub = True
|
||||
options.format = 'MOBI'
|
||||
if options.format == 'KFX+EPUB':
|
||||
options.keep_epub = True
|
||||
options.format = 'KFX'
|
||||
options.kfx = False
|
||||
if options.format == 'Auto':
|
||||
if options.profile in ['K1', 'K2', 'K34', 'K578', 'KPW', 'KPW5', 'KV', 'KO', 'K11', 'KS']:
|
||||
|
||||
@@ -309,7 +309,8 @@ class ComicPage:
|
||||
method = Image.Resampling.BICUBIC
|
||||
else:
|
||||
method = Image.Resampling.LANCZOS
|
||||
if self.opt.stretch or (self.opt.kfx and ('-KCC-B' in self.targetPath or '-KCC-C' in self.targetPath)):
|
||||
if self.opt.stretch:
|
||||
# if self.opt.stretch or (self.opt.kfx and ('-KCC-B' in self.targetPath or '-KCC-C' in self.targetPath)):
|
||||
self.image = self.image.resize(self.size, method)
|
||||
elif self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1] and not self.opt.upscale:
|
||||
if self.opt.format == 'CBZ' or self.opt.kfx:
|
||||
|
||||
Reference in New Issue
Block a user