diff --git a/README.md b/README.md index a091413..6379b8e 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ OUTPUT SETTINGS: --nokepub If format is EPUB, output file with '.epub' extension rather than '.kepub.epub' -b BATCHSPLIT, --batchsplit BATCHSPLIT Split output into multiple files. 0: Don't split 1: Automatic mode 2: Consider every subdirectory as separate volume [Default=0] - --dedupecover De-duplicate the cover as the first page in the book + --spreadshift Shift first page to opposite side in landscape for two page spread alignment CUSTOM PROFILE: --customwidth CUSTOMWIDTH diff --git a/gui/KCC.ui b/gui/KCC.ui index c6bab3c..b557ea0 100644 --- a/gui/KCC.ui +++ b/gui/KCC.ui @@ -196,12 +196,12 @@ - + - <html><head/><body><p>Don't duplicate the first page as the cover. Useful for 2 page spread alignment.</p></body></html> + <html><head/><body><p>Shift first page to opposite side in landscape. Useful for 2 page spread alignment.</p></body></html> - De-dupe cover + Spread shift @@ -241,9 +241,6 @@ 5 - - Qt::Orientation::Horizontal - @@ -282,9 +279,6 @@ 1 - - Qt::Orientation::Horizontal - @@ -489,13 +483,13 @@ QListWidget#jobList {background:#ffffff;background-image:url(:/Other/icons/list_background.png);background-position:center center;background-repeat:no-repeat;color:rgb(0,0,0);} - QAbstractItemView::SelectionMode::NoSelection + QAbstractItemView::NoSelection - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerItem - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerItem @@ -515,9 +509,6 @@ false - - Qt::AlignmentFlag::AlignJustify|Qt::AlignmentFlag::AlignVCenter - diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 4512471..c22611d 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -256,8 +256,8 @@ class WorkerThread(QtCore.QThread): options.noprocessing = True if GUI.deleteBox.isChecked(): options.delete = True - if GUI.dedupeCoverBox.isChecked(): - options.dedupecover = True + if GUI.spreadShiftBox.isChecked(): + options.spreadshift = True if GUI.mozJpegBox.checkState() == Qt.CheckState.PartiallyChecked: options.forcepng = True elif GUI.mozJpegBox.checkState() == Qt.CheckState.Checked: @@ -794,7 +794,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, + 'spreadShiftBox': GUI.spreadShiftBox.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 0c991f4..9a1cfef 100644 --- a/kindlecomicconverter/KCC_rc.py +++ b/kindlecomicconverter/KCC_rc.py @@ -11612,51 +11612,51 @@ 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\xc0\x00\x00\x00\x00\x00\x01\x00\x02.\xed\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xfe\x00\x00\x00\x00\x00\x01\x00\x02\x83\x87\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00\x02Y\x8c\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xd6\x00\x00\x00\x00\x00\x01\x00\x02N)\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x89\x89D9.\ \x00\x00\x00X\x00\x02\x00\x00\x00\x04\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\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00\xbc\x00\x00\x00\x00\x00\x01\x00\x011\xef\ -\x00\x00\x01\x93\xb0w\xb5I\ +\x00\x00\x01\x93\xdc\xec\x99\x8b\ \x00\x00\x00\x8c\x00\x00\x00\x00\x00\x01\x00\x01\x1d\x90\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x01:\x05\ -\x00\x00\x01\x93\xaa\xe2\xc3\xd8\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00X\x00\x02\x00\x00\x00\x03\x00\x00\x00\x11\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x02B\x00\x00\x00\x00\x00\x01\x00\x02\xb5\xd3\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcJ\ \x00\x00\x02\x14\x00\x00\x00\x00\x00\x01\x00\x02\x9f\xd6\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x02*\x00\x00\x00\x00\x00\x01\x00\x02\xa93\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x00X\x00\x02\x00\x00\x00\x07\x00\x00\x00\x15\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x01\x1c\x00\x00\x00\x00\x00\x01\x00\x01P\xb1\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcJ\ \x00\x00\x012\x00\x00\x00\x00\x00\x01\x00\x01yY\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x01\x94\x00\x00\x00\x00\x00\x01\x00\x01\xd2-\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x01z\x00\x00\x00\x00\x00\x01\x00\x01\x8c\xe6\ -\x00\x00\x01\x93\xaa\xe2\xc3\xf0\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x01\x04\x00\x00\x00\x00\x00\x01\x00\x01LR\ -\x00\x00\x01\x93\xaa\xe2\xc3\xe8\ +\x00\x00\x01\x88;p\xbcF\ \x00\x00\x00\xe8\x00\x00\x00\x00\x00\x01\x00\x01?\xe9\ -\x00\x00\x01\x93\xaa\xe2\xc3\xec\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x01T\x00\x00\x00\x00\x00\x01\x00\x01\x82\xb0\ -\x00\x00\x01\x93\xaa\xe2\xc3\xec\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x00X\x00\x02\x00\x00\x00\x01\x00\x00\x00\x1d\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00h\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x93\xaa\xe2\xc3\xec\ +\x00\x00\x01\x88;p\xbcH\ " def qInitResources(): diff --git a/kindlecomicconverter/KCC_ui.py b/kindlecomicconverter/KCC_ui.py index 4800d0b..9424569 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.6.3 +## Created by: Qt User Interface Compiler version 6.8.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -28,7 +28,7 @@ class Ui_mainWindow(object): mainWindow.setObjectName(u"mainWindow") mainWindow.resize(481, 400) icon = QIcon() - icon.addFile(u":/Icon/icons/comic2ebook.png", QSize(), QIcon.Normal, QIcon.Off) + icon.addFile(u":/Icon/icons/comic2ebook.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) mainWindow.setWindowIcon(icon) self.centralWidget = QWidget(mainWindow) self.centralWidget.setObjectName(u"centralWidget") @@ -116,10 +116,10 @@ class Ui_mainWindow(object): self.gridLayout_2.addWidget(self.disableProcessingBox, 4, 2, 1, 1) - self.dedupeCoverBox = QCheckBox(self.optionWidget) - self.dedupeCoverBox.setObjectName(u"dedupeCoverBox") + self.spreadShiftBox = QCheckBox(self.optionWidget) + self.spreadShiftBox.setObjectName(u"spreadShiftBox") - self.gridLayout_2.addWidget(self.dedupeCoverBox, 4, 0, 1, 1) + self.gridLayout_2.addWidget(self.spreadShiftBox, 4, 0, 1, 1) self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2) @@ -139,7 +139,6 @@ class Ui_mainWindow(object): self.gammaSlider.setObjectName(u"gammaSlider") self.gammaSlider.setMaximum(250) self.gammaSlider.setSingleStep(5) - self.gammaSlider.setOrientation(Qt.Orientation.Horizontal) self.horizontalLayout_2.addWidget(self.gammaSlider) @@ -161,7 +160,6 @@ class Ui_mainWindow(object): self.croppingPowerSlider.setObjectName(u"croppingPowerSlider") self.croppingPowerSlider.setMaximum(300) self.croppingPowerSlider.setSingleStep(1) - self.croppingPowerSlider.setOrientation(Qt.Orientation.Horizontal) self.horizontalLayout_3.addWidget(self.croppingPowerSlider) @@ -182,7 +180,7 @@ class Ui_mainWindow(object): self.directoryButton.setObjectName(u"directoryButton") self.directoryButton.setMinimumSize(QSize(0, 30)) icon1 = QIcon() - icon1.addFile(u":/Other/icons/folder_new.png", QSize(), QIcon.Normal, QIcon.Off) + icon1.addFile(u":/Other/icons/folder_new.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.directoryButton.setIcon(icon1) self.gridLayout_4.addWidget(self.directoryButton, 0, 0, 1, 1) @@ -191,7 +189,7 @@ class Ui_mainWindow(object): self.fileButton.setObjectName(u"fileButton") self.fileButton.setMinimumSize(QSize(0, 30)) icon2 = QIcon() - icon2.addFile(u":/Other/icons/document_new.png", QSize(), QIcon.Normal, QIcon.Off) + icon2.addFile(u":/Other/icons/document_new.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.fileButton.setIcon(icon2) self.gridLayout_4.addWidget(self.fileButton, 0, 3, 1, 1) @@ -215,7 +213,7 @@ class Ui_mainWindow(object): font.setBold(True) self.convertButton.setFont(font) icon3 = QIcon() - icon3.addFile(u":/Other/icons/convert.png", QSize(), QIcon.Normal, QIcon.Off) + icon3.addFile(u":/Other/icons/convert.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.convertButton.setIcon(icon3) self.gridLayout_4.addWidget(self.convertButton, 1, 2, 1, 1) @@ -224,7 +222,7 @@ class Ui_mainWindow(object): self.clearButton.setObjectName(u"clearButton") self.clearButton.setMinimumSize(QSize(0, 30)) icon4 = QIcon() - icon4.addFile(u":/Other/icons/clear.png", QSize(), QIcon.Normal, QIcon.Off) + icon4.addFile(u":/Other/icons/clear.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.clearButton.setIcon(icon4) self.gridLayout_4.addWidget(self.clearButton, 0, 2, 1, 1) @@ -247,7 +245,7 @@ class Ui_mainWindow(object): self.editorButton.setObjectName(u"editorButton") self.editorButton.setMinimumSize(QSize(0, 30)) icon5 = QIcon() - icon5.addFile(u":/Other/icons/editor.png", QSize(), QIcon.Normal, QIcon.Off) + icon5.addFile(u":/Other/icons/editor.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.editorButton.setIcon(icon5) self.horizontalLayout.addWidget(self.editorButton) @@ -256,7 +254,7 @@ class Ui_mainWindow(object): self.wikiButton.setObjectName(u"wikiButton") self.wikiButton.setMinimumSize(QSize(0, 30)) icon6 = QIcon() - icon6.addFile(u":/Other/icons/wiki.png", QSize(), QIcon.Normal, QIcon.Off) + icon6.addFile(u":/Other/icons/wiki.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.wikiButton.setIcon(icon6) self.horizontalLayout.addWidget(self.wikiButton) @@ -267,9 +265,9 @@ class Ui_mainWindow(object): self.jobList = QListWidget(self.centralWidget) self.jobList.setObjectName(u"jobList") self.jobList.setStyleSheet(u"QListWidget#jobList {background:#ffffff;background-image:url(:/Other/icons/list_background.png);background-position:center center;background-repeat:no-repeat;color:rgb(0,0,0);}") - self.jobList.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) - self.jobList.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) - self.jobList.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + self.jobList.setSelectionMode(QAbstractItemView.NoSelection) + self.jobList.setVerticalScrollMode(QAbstractItemView.ScrollPerItem) + self.jobList.setHorizontalScrollMode(QAbstractItemView.ScrollPerItem) self.gridLayout.addWidget(self.jobList, 2, 0, 1, 2) @@ -278,7 +276,6 @@ class Ui_mainWindow(object): self.progressBar.setMinimumSize(QSize(0, 30)) self.progressBar.setFont(font) self.progressBar.setVisible(False) - self.progressBar.setAlignment(Qt.AlignmentFlag.AlignJustify|Qt.AlignmentFlag.AlignVCenter) self.gridLayout.addWidget(self.progressBar, 1, 0, 1, 2) @@ -416,9 +413,9 @@ class Ui_mainWindow(object): #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)) + self.spreadShiftBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Shift first page to opposite side in landscape. Useful for 2 page spread alignment.

", None)) #endif // QT_CONFIG(tooltip) - self.dedupeCoverBox.setText(QCoreApplication.translate("mainWindow", u"De-dupe cover", None)) + self.spreadShiftBox.setText(QCoreApplication.translate("mainWindow", u"Spread shift", 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 051b92b..b02f2d9 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.6.3 +## Created by: Qt User Interface Compiler version 6.8.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -27,7 +27,7 @@ class Ui_editorDialog(object): editorDialog.resize(400, 260) editorDialog.setMinimumSize(QSize(400, 260)) icon = QIcon() - icon.addFile(u":/Icon/icons/comic2ebook.png", QSize(), QIcon.Normal, QIcon.Off) + icon.addFile(u":/Icon/icons/comic2ebook.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) editorDialog.setWindowIcon(icon) self.verticalLayout = QVBoxLayout(editorDialog) self.verticalLayout.setObjectName(u"verticalLayout") @@ -129,7 +129,7 @@ class Ui_editorDialog(object): self.okButton.setObjectName(u"okButton") self.okButton.setMinimumSize(QSize(0, 30)) icon1 = QIcon() - icon1.addFile(u":/Other/icons/convert.png", QSize(), QIcon.Normal, QIcon.Off) + icon1.addFile(u":/Other/icons/convert.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.okButton.setIcon(icon1) self.horizontalLayout.addWidget(self.okButton) @@ -138,7 +138,7 @@ class Ui_editorDialog(object): self.cancelButton.setObjectName(u"cancelButton") self.cancelButton.setMinimumSize(QSize(0, 30)) icon2 = QIcon() - icon2.addFile(u":/Other/icons/clear.png", QSize(), QIcon.Normal, QIcon.Off) + icon2.addFile(u":/Other/icons/clear.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) self.cancelButton.setIcon(icon2) self.horizontalLayout.addWidget(self.cancelButton) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 717ce7a..3a9afcf 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -358,6 +358,11 @@ def buildOPF(dstdir, title, filelist, cover=None): else: f.write("\n\n") pageside = "left" + if options.spreadshift: + if pageside == "right": + pageside = "left" + else: + pageside = "right" if options.iskindle or options.supportSyntheticSpread: for entry in reflist: if options.righttoleft: @@ -521,9 +526,6 @@ def buildEPUB(path, chapternames, tomenumber, ischunked): '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])) @@ -544,13 +546,6 @@ def buildEPUB(path, chapternames, tomenumber, ischunked): for aChapter in options.chapters: pageid = aChapter[0] - - if options.dedupecover: - if pageid == 0: - continue - else: - pageid -= 1 - cur_diff = global_diff global_diff = 0 @@ -1008,8 +1003,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") + output_options.add_argument("--spreadshift", action="store_true", dest="spreadshift", default=False, + help="Shift first page to opposite side in landscape for spread alignment") 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")