From c35dd137eaca8f3e006f02d52f2167c4b3375dd9 Mon Sep 17 00:00:00 2001
From: Bruno Resende
Date: Fri, 17 May 2024 13:56:22 -0300
Subject: [PATCH] Add de-dupe cover option for landscape alignment (#561)
* Adds --author argument to CLI
* Add --prefercoverfile and --nocoveraspage arguments to CLI
* cover checks only run once
* Revert "cover checks only run once"
This reverts commit ad7b3cc106dca0945c853acf0bd971352c3aa1a8.
* split off author portion
* split off author
* remove prefercover
* whitespace fixes
* rename to duplicatecover
* whitespace fixes
* rename to dedupecover
* add dedupe to UI
---------
Co-authored-by: Alex Xu
---
gui/KCC.ui | 142 ++++++++++++++------------
kindlecomicconverter/KCC_gui.py | 3 +
kindlecomicconverter/KCC_rc.py | 38 +++----
kindlecomicconverter/KCC_ui.py | 141 +++++++++++++------------
kindlecomicconverter/KCC_ui_editor.py | 2 +-
kindlecomicconverter/comic2ebook.py | 15 ++-
6 files changed, 184 insertions(+), 157 deletions(-)
diff --git a/gui/KCC.ui b/gui/KCC.ui
index bcc1d20..c7ed201 100644
--- a/gui/KCC.ui
+++ b/gui/KCC.ui
@@ -37,59 +37,36 @@
0
- -
-
+
-
+
- <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span>Images smaller than device resolution will not be resized.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be preserved.</p></body></html>
+ <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - 4 panels<br/></span>Zoom each corner separately.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Indeterminate - 2 panels<br/></span>Zoom only the top and bottom of the page.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 4 high-quality panels<br/></span>Zoom each corner separately. Try to increase the quality of magnification. Check wiki for more details.</p></body></html>
- Stretch/Upscale
+ Panel View 4/2/HQ
true
- -
-
+
-
+
- <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Split<br/></span>Double page spreads will be cut into two separate pages.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Rotate and split<br/></span>Double page spreads will be displayed twice. First rotated and then split. </p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Rotate<br/></span>Double page spreads will be rotated.</p></body></html>
+ Delete input file(s) or directory. It's not recoverable!
- Spread splitter
-
-
- true
+ Delete input
- -
-
+
-
+
- <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - Automatic mode<br/></span>The output will be split automatically.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Checked - Volume mode<br/></span>Every subdirectory will be considered as a separate volume.</p></body></html>
+ <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - 1x4<br/></span>Keep format 1x4 panels strips.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 2x2<br/></span>Turn 1x4 strips to 2x2 to maximize screen usage.</p></body></html>
- Output split
-
-
-
- -
-
-
- <html><head/><body><p style='white-space:pre'>Enable special parsing mode for Korean Webtoons.</p></body></html>
-
-
- Webtoon mode
-
-
-
- -
-
-
- <html><head/><body><p style='white-space:pre'>Disable conversion to grayscale.</p></body></html>
-
-
- Color mode
+ 1x4 to 2x2 strips
@@ -116,6 +93,29 @@
+ -
+
+
+ <html><head/><body><p style='white-space:pre'>Enable special parsing mode for Korean Webtoons.</p></body></html>
+
+
+ Webtoon mode
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span>Images smaller than device resolution will not be resized.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be preserved.</p></body></html>
+
+
+ Stretch/Upscale
+
+
+ true
+
+
+
-
@@ -126,42 +126,19 @@
- -
-
+
-
+
- <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - 4 panels<br/></span>Zoom each corner separately.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Indeterminate - 2 panels<br/></span>Zoom only the top and bottom of the page.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 4 high-quality panels<br/></span>Zoom each corner separately. Try to increase the quality of magnification. Check wiki for more details.</p></body></html>
+ <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Split<br/></span>Double page spreads will be cut into two separate pages.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Rotate and split<br/></span>Double page spreads will be displayed twice. First rotated and then split. </p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Rotate<br/></span>Double page spreads will be rotated.</p></body></html>
- Panel View 4/2/HQ
+ Spread splitter
true
- -
-
-
- <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - JPEG<br/></span>Use JPEG files</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - force PNG<br/></span>Create PNG files instead JPEG</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - mozJpeg<br/></span>10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2</p></body></html>
-
-
- JPEG/PNG/mozJpeg
-
-
- true
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - 1x4<br/></span>Keep format 1x4 panels strips.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 2x2<br/></span>Turn 1x4 strips to 2x2 to maximize screen usage.</p></body></html>
-
-
- 1x4 to 2x2 strips
-
-
-
-
@@ -175,13 +152,36 @@
- -
-
+
-
+
- Delete input file(s) or directory. It's not recoverable!
+ <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - Automatic mode<br/></span>The output will be split automatically.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Checked - Volume mode<br/></span>Every subdirectory will be considered as a separate volume.</p></body></html>
- Delete input
+ Output split
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - JPEG<br/></span>Use JPEG files</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - force PNG<br/></span>Create PNG files instead JPEG</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - mozJpeg<br/></span>10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2</p></body></html>
+
+
+ JPEG/PNG/mozJpeg
+
+
+ true
+
+
+
+ -
+
+
+ <html><head/><body><p style='white-space:pre'>Disable conversion to grayscale.</p></body></html>
+
+
+ Color mode
@@ -195,6 +195,16 @@
+ -
+
+
+ <html><head/><body><p>Don't duplicate the first page as the cover. Useful for 2 page spread alignment.</p></body></html>
+
+
+ De-dupe cover
+
+
+
diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py
index 42a5adc..18f30e1 100644
--- a/kindlecomicconverter/KCC_gui.py
+++ b/kindlecomicconverter/KCC_gui.py
@@ -254,6 +254,8 @@ class WorkerThread(QtCore.QThread):
options.noprocessing = True
if GUI.deleteBox.isChecked():
options.delete = True
+ if GUI.dedupeCoverBox.isChecked():
+ options.dedupecover = True
if GUI.mozJpegBox.checkState() == Qt.CheckState.PartiallyChecked:
options.forcepng = True
elif GUI.mozJpegBox.checkState() == Qt.CheckState.Checked:
@@ -789,6 +791,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
'widthBox': GUI.widthBox.value(),
'heightBox': GUI.heightBox.value(),
'deleteBox': GUI.deleteBox.checkState().value,
+ 'dedupeCoverBox': GUI.dedupeCoverBox.checkState().value,
'maximizeStrips': GUI.maximizeStrips.checkState().value,
'gammaSlider': float(self.gammaValue) * 100})
self.settings.sync()
diff --git a/kindlecomicconverter/KCC_rc.py b/kindlecomicconverter/KCC_rc.py
index 758b5ee..f7b740d 100644
--- a/kindlecomicconverter/KCC_rc.py
+++ b/kindlecomicconverter/KCC_rc.py
@@ -1,6 +1,6 @@
# Resource object code (Python 3)
# Created by: object code
-# Created by: The Resource Compiler for Qt version 6.5.1
+# Created by: The Resource Compiler for Qt version 6.5.2
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
@@ -11476,49 +11476,49 @@ qt_resource_struct = b"\
\x00\x00\x00X\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x01\xac\x00\x00\x00\x00\x00\x01\x00\x02&\xd7\
-\x00\x00\x01\x89\x0c\xe8\xc1\x86\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00\x02{q\
-\x00\x00\x01\x89\x0c\xe8\xc1\x85\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xd6\x00\x00\x00\x00\x00\x01\x00\x02Qv\
-\x00\x00\x01\x89\x0c\xe8\xc1\x84\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xc2\x00\x00\x00\x00\x00\x01\x00\x02F\x13\
-\x00\x00\x01\x89\x0c\xe8\xc1\x85\
+\x00\x00\x01\x89\x89D9.\
\x00\x00\x00X\x00\x02\x00\x00\x00\x03\x00\x00\x00\x0c\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\xa6\x00\x00\x00\x00\x00\x01\x00\x01(\x97\
-\x00\x00\x01\x89\x0c\xe8\xc1\x86\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x00\x8c\x00\x00\x00\x00\x00\x01\x00\x01\x1d\x90\
-\x00\x00\x01\x89\x0c\xe8\xc1\x86\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x00\xbc\x00\x00\x00\x00\x00\x01\x00\x011\xef\
-\x00\x00\x01\x89\x0c\xe8\xc1\x87\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x00X\x00\x02\x00\x00\x00\x03\x00\x00\x00\x10\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x02.\x00\x00\x00\x00\x00\x01\x00\x02\xad\xbd\
-\x00\x00\x01\x89\x0c\xe8\xc1\x9a\
+\x00\x00\x01\x88;p\xbcJ\
\x00\x00\x02\x00\x00\x00\x00\x00\x00\x01\x00\x02\x97\xc0\
-\x00\x00\x01\x89\x0c\xe8\xc1\x98\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x02\x16\x00\x00\x00\x00\x00\x01\x00\x02\xa1\x1d\
-\x00\x00\x01\x89\x0c\xe8\xc1\x97\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x00X\x00\x02\x00\x00\x00\x07\x00\x00\x00\x14\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x01\x08\x00\x00\x00\x00\x00\x01\x00\x01H\x9b\
-\x00\x00\x01\x89\x0c\xe8\xc1\x9b\
+\x00\x00\x01\x88;p\xbcJ\
\x00\x00\x01\x1e\x00\x00\x00\x00\x00\x01\x00\x01qC\
-\x00\x00\x01\x89\x0c\xe8\xc1\x97\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x01\x80\x00\x00\x00\x00\x00\x01\x00\x01\xca\x17\
-\x00\x00\x01\x89\x0c\xe8\xc1\x98\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x01f\x00\x00\x00\x00\x00\x01\x00\x01\x84\xd0\
-\x00\x00\x01\x89\x0c\xe8\xc1\x97\
+\x00\x00\x01\x88;p\xbcH\
\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x01\x00\x01D<\
-\x00\x00\x01\x89\x0c\xe8\xc1\x8f\
+\x00\x00\x01\x88;p\xbcF\
\x00\x00\x00\xd4\x00\x00\x00\x00\x00\x01\x00\x017\xd3\
-\x00\x00\x01\x89\x0c\xe8\xc1\x96\
+\x00\x00\x01\x88;p\xbcH\
\x00\x00\x01@\x00\x00\x00\x00\x00\x01\x00\x01z\x9a\
-\x00\x00\x01\x89\x0c\xe8\xc1\x96\
+\x00\x00\x01\x88;p\xbcH\
\x00\x00\x00X\x00\x02\x00\x00\x00\x01\x00\x00\x00\x1c\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00h\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-\x00\x00\x01\x89\x0c\xe8\xc1\x96\
+\x00\x00\x01\x88;p\xbcH\
"
def qInitResources():
diff --git a/kindlecomicconverter/KCC_ui.py b/kindlecomicconverter/KCC_ui.py
index 0e37c8e..4c8cf3c 100644
--- a/kindlecomicconverter/KCC_ui.py
+++ b/kindlecomicconverter/KCC_ui.py
@@ -3,7 +3,7 @@
################################################################################
## Form generated from reading UI file 'KCC.ui'
##
-## Created by: Qt User Interface Compiler version 6.5.1
+## Created by: Qt User Interface Compiler version 6.5.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
@@ -40,32 +40,21 @@ class Ui_mainWindow(object):
self.gridLayout_2 = QGridLayout(self.optionWidget)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
- self.upscaleBox = QCheckBox(self.optionWidget)
- self.upscaleBox.setObjectName(u"upscaleBox")
- self.upscaleBox.setTristate(True)
+ self.qualityBox = QCheckBox(self.optionWidget)
+ self.qualityBox.setObjectName(u"qualityBox")
+ self.qualityBox.setTristate(True)
- self.gridLayout_2.addWidget(self.upscaleBox, 1, 1, 1, 1)
+ self.gridLayout_2.addWidget(self.qualityBox, 0, 2, 1, 1)
- self.rotateBox = QCheckBox(self.optionWidget)
- self.rotateBox.setObjectName(u"rotateBox")
- self.rotateBox.setTristate(True)
+ self.deleteBox = QCheckBox(self.optionWidget)
+ self.deleteBox.setObjectName(u"deleteBox")
- self.gridLayout_2.addWidget(self.rotateBox, 0, 1, 1, 1)
+ self.gridLayout_2.addWidget(self.deleteBox, 4, 1, 1, 1)
- self.outputSplit = QCheckBox(self.optionWidget)
- self.outputSplit.setObjectName(u"outputSplit")
+ self.maximizeStrips = QCheckBox(self.optionWidget)
+ self.maximizeStrips.setObjectName(u"maximizeStrips")
- self.gridLayout_2.addWidget(self.outputSplit, 2, 1, 1, 1)
-
- self.webtoonBox = QCheckBox(self.optionWidget)
- self.webtoonBox.setObjectName(u"webtoonBox")
-
- self.gridLayout_2.addWidget(self.webtoonBox, 1, 0, 1, 1)
-
- self.colorBox = QCheckBox(self.optionWidget)
- self.colorBox.setObjectName(u"colorBox")
-
- self.gridLayout_2.addWidget(self.colorBox, 2, 2, 1, 1)
+ self.gridLayout_2.addWidget(self.maximizeStrips, 3, 1, 1, 1)
self.gammaBox = QCheckBox(self.optionWidget)
self.gammaBox.setObjectName(u"gammaBox")
@@ -78,27 +67,27 @@ class Ui_mainWindow(object):
self.gridLayout_2.addWidget(self.borderBox, 2, 0, 1, 1)
+ self.webtoonBox = QCheckBox(self.optionWidget)
+ self.webtoonBox.setObjectName(u"webtoonBox")
+
+ self.gridLayout_2.addWidget(self.webtoonBox, 1, 0, 1, 1)
+
+ self.upscaleBox = QCheckBox(self.optionWidget)
+ self.upscaleBox.setObjectName(u"upscaleBox")
+ self.upscaleBox.setTristate(True)
+
+ self.gridLayout_2.addWidget(self.upscaleBox, 1, 1, 1, 1)
+
self.mangaBox = QCheckBox(self.optionWidget)
self.mangaBox.setObjectName(u"mangaBox")
self.gridLayout_2.addWidget(self.mangaBox, 0, 0, 1, 1)
- self.qualityBox = QCheckBox(self.optionWidget)
- self.qualityBox.setObjectName(u"qualityBox")
- self.qualityBox.setTristate(True)
+ self.rotateBox = QCheckBox(self.optionWidget)
+ self.rotateBox.setObjectName(u"rotateBox")
+ self.rotateBox.setTristate(True)
- self.gridLayout_2.addWidget(self.qualityBox, 0, 2, 1, 1)
-
- self.mozJpegBox = QCheckBox(self.optionWidget)
- self.mozJpegBox.setObjectName(u"mozJpegBox")
- self.mozJpegBox.setTristate(True)
-
- self.gridLayout_2.addWidget(self.mozJpegBox, 3, 0, 1, 1)
-
- self.maximizeStrips = QCheckBox(self.optionWidget)
- self.maximizeStrips.setObjectName(u"maximizeStrips")
-
- self.gridLayout_2.addWidget(self.maximizeStrips, 3, 1, 1, 1)
+ self.gridLayout_2.addWidget(self.rotateBox, 0, 1, 1, 1)
self.croppingBox = QCheckBox(self.optionWidget)
self.croppingBox.setObjectName(u"croppingBox")
@@ -106,16 +95,32 @@ class Ui_mainWindow(object):
self.gridLayout_2.addWidget(self.croppingBox, 3, 2, 1, 1)
- self.deleteBox = QCheckBox(self.optionWidget)
- self.deleteBox.setObjectName(u"deleteBox")
+ self.outputSplit = QCheckBox(self.optionWidget)
+ self.outputSplit.setObjectName(u"outputSplit")
- self.gridLayout_2.addWidget(self.deleteBox, 4, 1, 1, 1)
+ self.gridLayout_2.addWidget(self.outputSplit, 2, 1, 1, 1)
+
+ self.mozJpegBox = QCheckBox(self.optionWidget)
+ self.mozJpegBox.setObjectName(u"mozJpegBox")
+ self.mozJpegBox.setTristate(True)
+
+ self.gridLayout_2.addWidget(self.mozJpegBox, 3, 0, 1, 1)
+
+ self.colorBox = QCheckBox(self.optionWidget)
+ self.colorBox.setObjectName(u"colorBox")
+
+ self.gridLayout_2.addWidget(self.colorBox, 2, 2, 1, 1)
self.disableProcessingBox = QCheckBox(self.optionWidget)
self.disableProcessingBox.setObjectName(u"disableProcessingBox")
self.gridLayout_2.addWidget(self.disableProcessingBox, 4, 2, 1, 1)
+ self.dedupeCoverBox = QCheckBox(self.optionWidget)
+ self.dedupeCoverBox.setObjectName(u"dedupeCoverBox")
+
+ self.gridLayout_2.addWidget(self.dedupeCoverBox, 4, 0, 1, 1)
+
self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2)
@@ -355,25 +360,17 @@ class Ui_mainWindow(object):
def retranslateUi(self, mainWindow):
mainWindow.setWindowTitle(QCoreApplication.translate("mainWindow", u"Kindle Comic Converter", None))
#if QT_CONFIG(tooltip)
- self.upscaleBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Nothing
Images smaller than device resolution will not be resized.
Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.
Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.
", None))
+ self.qualityBox.setToolTip(QCoreApplication.translate("mainWindow", u" Unchecked - 4 panels
Zoom each corner separately.
Indeterminate - 2 panels
Zoom only the top and bottom of the page.
Checked - 4 high-quality panels
Zoom each corner separately. Try to increase the quality of magnification. Check wiki for more details.
", None))
#endif // QT_CONFIG(tooltip)
- self.upscaleBox.setText(QCoreApplication.translate("mainWindow", u"Stretch/Upscale", None))
+ self.qualityBox.setText(QCoreApplication.translate("mainWindow", u"Panel View 4/2/HQ", None))
#if QT_CONFIG(tooltip)
- self.rotateBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Split
Double page spreads will be cut into two separate pages.
Indeterminate - Rotate and split
Double page spreads will be displayed twice. First rotated and then split.
Checked - Rotate
Double page spreads will be rotated.
", None))
+ self.deleteBox.setToolTip(QCoreApplication.translate("mainWindow", u"Delete input file(s) or directory. It's not recoverable!", None))
#endif // QT_CONFIG(tooltip)
- self.rotateBox.setText(QCoreApplication.translate("mainWindow", u"Spread splitter", None))
+ self.deleteBox.setText(QCoreApplication.translate("mainWindow", u"Delete input", None))
#if QT_CONFIG(tooltip)
- self.outputSplit.setToolTip(QCoreApplication.translate("mainWindow", u" Unchecked - Automatic mode
The output will be split automatically.
Checked - Volume mode
Every subdirectory will be considered as a separate volume.
", None))
+ self.maximizeStrips.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - 1x4
Keep format 1x4 panels strips.
Checked - 2x2
Turn 1x4 strips to 2x2 to maximize screen usage.
", None))
#endif // QT_CONFIG(tooltip)
- self.outputSplit.setText(QCoreApplication.translate("mainWindow", u"Output split", None))
-#if QT_CONFIG(tooltip)
- self.webtoonBox.setToolTip(QCoreApplication.translate("mainWindow", u"
Enable special parsing mode for Korean Webtoons.
", None))
-#endif // QT_CONFIG(tooltip)
- self.webtoonBox.setText(QCoreApplication.translate("mainWindow", u"Webtoon mode", None))
-#if QT_CONFIG(tooltip)
- self.colorBox.setToolTip(QCoreApplication.translate("mainWindow", u"Disable conversion to grayscale.
", None))
-#endif // QT_CONFIG(tooltip)
- self.colorBox.setText(QCoreApplication.translate("mainWindow", u"Color mode", None))
+ self.maximizeStrips.setText(QCoreApplication.translate("mainWindow", u"1x4 to 2x2 strips", None))
#if QT_CONFIG(tooltip)
self.gammaBox.setToolTip(QCoreApplication.translate("mainWindow", u"Disable automatic gamma correction.
", None))
#endif // QT_CONFIG(tooltip)
@@ -382,34 +379,46 @@ class Ui_mainWindow(object):
self.borderBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Autodetection
The color of margins fill will be detected automatically.
Indeterminate - White
Margins will be filled with white color.
Checked - Black
Margins will be filled with black color.
", None))
#endif // QT_CONFIG(tooltip)
self.borderBox.setText(QCoreApplication.translate("mainWindow", u"W/B margins", None))
+#if QT_CONFIG(tooltip)
+ self.webtoonBox.setToolTip(QCoreApplication.translate("mainWindow", u"Enable special parsing mode for Korean Webtoons.
", None))
+#endif // QT_CONFIG(tooltip)
+ self.webtoonBox.setText(QCoreApplication.translate("mainWindow", u"Webtoon mode", None))
+#if QT_CONFIG(tooltip)
+ self.upscaleBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Nothing
Images smaller than device resolution will not be resized.
Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.
Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.
", None))
+#endif // QT_CONFIG(tooltip)
+ self.upscaleBox.setText(QCoreApplication.translate("mainWindow", u"Stretch/Upscale", None))
#if QT_CONFIG(tooltip)
self.mangaBox.setToolTip(QCoreApplication.translate("mainWindow", u"Enable right-to-left reading.
", None))
#endif // QT_CONFIG(tooltip)
self.mangaBox.setText(QCoreApplication.translate("mainWindow", u"Manga mode", None))
#if QT_CONFIG(tooltip)
- self.qualityBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - 4 panels
Zoom each corner separately.
Indeterminate - 2 panels
Zoom only the top and bottom of the page.
Checked - 4 high-quality panels
Zoom each corner separately. Try to increase the quality of magnification. Check wiki for more details.
", None))
+ self.rotateBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Split
Double page spreads will be cut into two separate pages.
Indeterminate - Rotate and split
Double page spreads will be displayed twice. First rotated and then split.
Checked - Rotate
Double page spreads will be rotated.
", None))
#endif // QT_CONFIG(tooltip)
- self.qualityBox.setText(QCoreApplication.translate("mainWindow", u"Panel View 4/2/HQ", None))
-#if QT_CONFIG(tooltip)
- self.mozJpegBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - JPEG
Use JPEG files
Indeterminate - force PNG
Create PNG files instead JPEG
Checked - mozJpeg
10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2
", None))
-#endif // QT_CONFIG(tooltip)
- self.mozJpegBox.setText(QCoreApplication.translate("mainWindow", u"JPEG/PNG/mozJpeg", None))
-#if QT_CONFIG(tooltip)
- self.maximizeStrips.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - 1x4
Keep format 1x4 panels strips.
Checked - 2x2
Turn 1x4 strips to 2x2 to maximize screen usage.
", None))
-#endif // QT_CONFIG(tooltip)
- self.maximizeStrips.setText(QCoreApplication.translate("mainWindow", u"1x4 to 2x2 strips", None))
+ self.rotateBox.setText(QCoreApplication.translate("mainWindow", u"Spread splitter", None))
#if QT_CONFIG(tooltip)
self.croppingBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Disabled
Disabled
Indeterminate - Margins
Margins
Checked - Margins + page numbers
Margins +page numbers
", None))
#endif // QT_CONFIG(tooltip)
self.croppingBox.setText(QCoreApplication.translate("mainWindow", u"Cropping mode", None))
#if QT_CONFIG(tooltip)
- self.deleteBox.setToolTip(QCoreApplication.translate("mainWindow", u"Delete input file(s) or directory. It's not recoverable!", None))
+ self.outputSplit.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - Automatic mode
The output will be split automatically.
Checked - Volume mode
Every subdirectory will be considered as a separate volume.
", None))
#endif // QT_CONFIG(tooltip)
- self.deleteBox.setText(QCoreApplication.translate("mainWindow", u"Delete input", None))
+ self.outputSplit.setText(QCoreApplication.translate("mainWindow", u"Output split", None))
+#if QT_CONFIG(tooltip)
+ self.mozJpegBox.setToolTip(QCoreApplication.translate("mainWindow", u"Unchecked - JPEG
Use JPEG files
Indeterminate - force PNG
Create PNG files instead JPEG
Checked - mozJpeg
10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2
", None))
+#endif // QT_CONFIG(tooltip)
+ self.mozJpegBox.setText(QCoreApplication.translate("mainWindow", u"JPEG/PNG/mozJpeg", None))
+#if QT_CONFIG(tooltip)
+ self.colorBox.setToolTip(QCoreApplication.translate("mainWindow", u"Disable conversion to grayscale.
", None))
+#endif // QT_CONFIG(tooltip)
+ self.colorBox.setText(QCoreApplication.translate("mainWindow", u"Color mode", None))
#if QT_CONFIG(tooltip)
self.disableProcessingBox.setToolTip(QCoreApplication.translate("mainWindow", u"Do not process any image, ignore profile and processing options
", None))
#endif // QT_CONFIG(tooltip)
self.disableProcessingBox.setText(QCoreApplication.translate("mainWindow", u"Disable processing", None))
+#if QT_CONFIG(tooltip)
+ self.dedupeCoverBox.setToolTip(QCoreApplication.translate("mainWindow", u"Don't duplicate the first page as the cover. Useful for 2 page spread alignment.
", None))
+#endif // QT_CONFIG(tooltip)
+ self.dedupeCoverBox.setText(QCoreApplication.translate("mainWindow", u"De-dupe cover", None))
self.gammaLabel.setText(QCoreApplication.translate("mainWindow", u"Gamma: Auto", None))
self.croppingPowerLabel.setText(QCoreApplication.translate("mainWindow", u"Cropping power:", None))
#if QT_CONFIG(tooltip)
diff --git a/kindlecomicconverter/KCC_ui_editor.py b/kindlecomicconverter/KCC_ui_editor.py
index 2b5c2ac..6729adc 100644
--- a/kindlecomicconverter/KCC_ui_editor.py
+++ b/kindlecomicconverter/KCC_ui_editor.py
@@ -3,7 +3,7 @@
################################################################################
## Form generated from reading UI file 'MetaEditor.ui'
##
-## Created by: Qt User Interface Compiler version 6.5.1
+## Created by: Qt User Interface Compiler version 6.5.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py
index 182fb2d..48d439d 100755
--- a/kindlecomicconverter/comic2ebook.py
+++ b/kindlecomicconverter/comic2ebook.py
@@ -504,15 +504,18 @@ def buildEPUB(path, chapternames, tomenumber):
chapter = False
dirnames, filenames = walkSort(dirnames, filenames)
for afile in filenames:
+ if cover is None:
+ cover = os.path.join(os.path.join(path, 'OEBPS', 'Images'),
+ 'cover' + getImageFileName(afile)[1])
+ options.covers.append((image.Cover(os.path.join(dirpath, afile), cover, options,
+ tomenumber), options.uuid))
+ if options.dedupecover:
+ os.remove(os.path.join(dirpath, afile))
+ continue
filelist.append(buildHTML(dirpath, afile, os.path.join(dirpath, afile)))
if not chapter:
chapterlist.append((dirpath.replace('Images', 'Text'), filelist[-1][1]))
chapter = True
- if cover is None:
- cover = os.path.join(os.path.join(path, 'OEBPS', 'Images'),
- 'cover' + getImageFileName(filelist[-1][1])[1])
- options.covers.append((image.Cover(os.path.join(filelist[-1][0], filelist[-1][1]), cover, options,
- tomenumber), options.uuid))
# Overwrite chapternames if tree is flat and ComicInfo.xml has bookmarks
if not chapternames and options.chapters:
chapterlist = []
@@ -981,6 +984,8 @@ def makeParser():
output_options.add_argument("-b", "--batchsplit", type=int, dest="batchsplit", default="0",
help="Split output into multiple files. 0: Don't split 1: Automatic mode "
"2: Consider every subdirectory as separate volume [Default=0]")
+ output_options.add_argument("--dedupecover", action="store_true", dest="dedupecover", default=False,
+ help="De-duplicate the cover as the first page in the book")
processing_options.add_argument("-n", "--noprocessing", action="store_true", dest="noprocessing", default=False,
help="Do not modify image and ignore any profil or processing option")