Skip to content

Commit

Permalink
Fix spread splitter not keeping aspect ratio (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
darodi authored Dec 30, 2022
1 parent 88ffcef commit b608096
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

#### 5.5.3b18:
* Spread splitter not keeping aspect ratio [darodi/kcc#27](https://github.com/darodi/kcc/issues/27), thanks [@darodi](https://github.com/darodi)

#### 5.5.3b17:
* activate batchsplit only for EPUB-200 [darodi/kcc#24](https://github.com/darodi/kcc/issues/24), thanks [@darodi](https://github.com/darodi)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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
Expand Down
4 changes: 1 addition & 3 deletions kindlecomicconverter/KCC_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ def __init__(self):
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)

Expand Down Expand Up @@ -1114,7 +1112,7 @@ def __init__(self, kccapp, kccwindow):
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():
Expand Down
2 changes: 1 addition & 1 deletion kindlecomicconverter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '5.5.3b17'
__version__ = '5.5.3b18'
__license__ = 'ISC'
__copyright__ = '2012-2022, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>, darodi'
__docformat__ = 'restructuredtext en'
5 changes: 1 addition & 4 deletions kindlecomicconverter/comic2ebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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']:
Expand Down
3 changes: 2 additions & 1 deletion kindlecomicconverter/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def resizeImage(self):
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:
Expand Down

0 comments on commit b608096

Please sign in to comment.