From eef5a85fa65bf0b8633fad555835d9c27fdf61ec Mon Sep 17 00:00:00 2001
From: jorge-castellon-jr
<31225261+jorge-castellon-jr@users.noreply.github.com>
Date: Mon, 16 Jun 2025 11:58:26 -0700
Subject: [PATCH] ComicInfo.xml Title checkbox (#944)
* Adds options to use metadata title as output name
* update .ui files
* write rest
* small fixes
* small fix
* fix small
---------
Co-authored-by: Alex Xu
---
README.md | 1 +
gui/KCC.ui | 10 ++++++++
kindlecomicconverter/KCC_gui.py | 3 +++
kindlecomicconverter/KCC_rc.py | 38 ++++++++++++++---------------
kindlecomicconverter/KCC_ui.py | 9 +++++++
kindlecomicconverter/comic2ebook.py | 6 ++++-
6 files changed, 47 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index a81f049..398476d 100644
--- a/README.md
+++ b/README.md
@@ -234,6 +234,7 @@ OUTPUT SETTINGS:
Output generated file to specified directory or file
-t TITLE, --title TITLE
Comic title [Default=filename or directory name]
+ --comicinfotitle Write title from ComicInfo.xml
-a AUTHOR, --author AUTHOR
Author name [Default=KCC]
-f FORMAT, --format FORMAT
diff --git a/gui/KCC.ui b/gui/KCC.ui
index 4991751..3ab1972 100644
--- a/gui/KCC.ui
+++ b/gui/KCC.ui
@@ -653,6 +653,16 @@
+ -
+
+
+ Write Title from ComicInfo.xml
+
+
+ ComicInfo Title
+
+
+
diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py
index 87c83d9..5f8b6ac 100644
--- a/kindlecomicconverter/KCC_gui.py
+++ b/kindlecomicconverter/KCC_gui.py
@@ -263,6 +263,8 @@ class WorkerThread(QThread):
options.maximizestrips = True
if GUI.disableProcessingBox.isChecked():
options.noprocessing = True
+ if GUI.comicinfoTitleBox.isChecked():
+ options.comicinfotitle = True
if GUI.deleteBox.isChecked():
options.delete = True
if GUI.spreadShiftBox.isChecked():
@@ -843,6 +845,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
'colorBox': GUI.colorBox.checkState().value,
'reduceRainbowBox': GUI.reduceRainbowBox.checkState().value,
'disableProcessingBox': GUI.disableProcessingBox.checkState().value,
+ 'comicinfoTitleBox': GUI.comicinfoTitleBox.checkState().value,
'mozJpegBox': GUI.mozJpegBox.checkState().value,
'widthBox': GUI.widthBox.value(),
'heightBox': GUI.heightBox.value(),
diff --git a/kindlecomicconverter/KCC_rc.py b/kindlecomicconverter/KCC_rc.py
index 46ed290..38757b4 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\x97\x5c>\xea\xe6\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xfe\x00\x00\x00\x00\x00\x01\x00\x02\x83\x87\
-\x00\x00\x01\x97\x5c>\xea\xe5\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00\x02Y\x8c\
-\x00\x00\x01\x97\x5c>\xea\xe4\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x01\xd6\x00\x00\x00\x00\x00\x01\x00\x02N)\
-\x00\x00\x01\x97\x5c>\xea\xe5\
+\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\x97\x5c>\xea\xe6\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x00\xbc\x00\x00\x00\x00\x00\x01\x00\x011\xef\
-\x00\x00\x01\x97\x5c>\xea\xe7\
+\x00\x00\x01\x96\x16b\x1f\x99\
\x00\x00\x00\x8c\x00\x00\x00\x00\x00\x01\x00\x01\x1d\x90\
-\x00\x00\x01\x97\x5c>\xea\xe5\
+\x00\x00\x01\x88;p\xbcB\
\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x01:\x05\
-\x00\x00\x01\x97\x5c>\xea\xe6\
+\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\x97\x5c>\xea\xf1\
+\x00\x00\x01\x88;p\xbcJ\
\x00\x00\x02\x14\x00\x00\x00\x00\x00\x01\x00\x02\x9f\xd6\
-\x00\x00\x01\x97\x5c>\xea\xf0\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x02*\x00\x00\x00\x00\x00\x01\x00\x02\xa93\
-\x00\x00\x01\x97\x5c>\xea\xef\
+\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\x97\x5c>\xea\xf1\
+\x00\x00\x01\x88;p\xbcJ\
\x00\x00\x012\x00\x00\x00\x00\x00\x01\x00\x01yY\
-\x00\x00\x01\x97\x5c>\xea\xef\
+\x00\x00\x01\x88;p\xbcI\
\x00\x00\x01\x94\x00\x00\x00\x00\x00\x01\x00\x01\xd2-\
-\x00\x00\x01\x97\x5c>\xea\xf0\
+\x00\x00\x01\x94\xb4\xd4\xf0a\
\x00\x00\x01z\x00\x00\x00\x00\x00\x01\x00\x01\x8c\xe6\
-\x00\x00\x01\x97\x5c>\xea\xef\
+\x00\x00\x01\x88;p\xbcH\
\x00\x00\x01\x04\x00\x00\x00\x00\x00\x01\x00\x01LR\
-\x00\x00\x01\x97\x5c>\xea\xea\
+\x00\x00\x01\x88;p\xbcF\
\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x01\x00\x01?\xe9\
-\x00\x00\x01\x97\x5c>\xea\xee\
+\x00\x00\x01\x88;p\xbcH\
\x00\x00\x01T\x00\x00\x00\x00\x00\x01\x00\x01\x82\xb0\
-\x00\x00\x01\x97\x5c>\xea\xef\
+\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\x97\x5c>\xea\xee\
+\x00\x00\x01\x88;p\xbcH\
"
def qInitResources():
diff --git a/kindlecomicconverter/KCC_ui.py b/kindlecomicconverter/KCC_ui.py
index 288b950..6f3a1e2 100644
--- a/kindlecomicconverter/KCC_ui.py
+++ b/kindlecomicconverter/KCC_ui.py
@@ -351,6 +351,11 @@ class Ui_mainWindow(object):
self.gridLayout_2.addWidget(self.chunkSizeCheckBox, 7, 1, 1, 1)
+ self.comicinfoTitleBox = QCheckBox(self.optionWidget)
+ self.comicinfoTitleBox.setObjectName(u"comicinfoTitleBox")
+
+ self.gridLayout_2.addWidget(self.comicinfoTitleBox, 7, 0, 1, 1)
+
self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2)
@@ -584,6 +589,10 @@ class Ui_mainWindow(object):
self.chunkSizeCheckBox.setToolTip(QCoreApplication.translate("mainWindow", u"
Unchecked
Maximal output file size is 100 MB for Webtoon, 400 MB for others before split occurs.
Checked
Output file size specified in "Chunk size MB" before split occurs.
", None))
#endif // QT_CONFIG(tooltip)
self.chunkSizeCheckBox.setText(QCoreApplication.translate("mainWindow", u"Chunk size", None))
+#if QT_CONFIG(tooltip)
+ self.comicinfoTitleBox.setToolTip(QCoreApplication.translate("mainWindow", u"Write Title from ComicInfo.xml", None))
+#endif // QT_CONFIG(tooltip)
+ self.comicinfoTitleBox.setText(QCoreApplication.translate("mainWindow", u"ComicInfo Title", None))
self.gammaLabel.setText(QCoreApplication.translate("mainWindow", u"Gamma: Auto", None))
#if QT_CONFIG(tooltip)
self.chunkSizeWidget.setToolTip(QCoreApplication.translate("mainWindow", u"Warning: chunk size greater than default may cause
performance/battery issues, especially on older devices.
", None))
diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py
index 9f9d5da..302624e 100755
--- a/kindlecomicconverter/comic2ebook.py
+++ b/kindlecomicconverter/comic2ebook.py
@@ -757,7 +757,9 @@ def getComicInfo(path, originalpath):
except Exception:
os.remove(xmlPath)
return
- if defaultTitle:
+ if options.comicinfotitle:
+ options.title = xml.data['Title']
+ elif defaultTitle:
if xml.data['Series']:
options.title = xml.data['Series']
if xml.data['Volume']:
@@ -1066,6 +1068,8 @@ def makeParser():
help="Output generated file to specified directory or file")
output_options.add_argument("-t", "--title", action="store", dest="title", default="defaulttitle",
help="Comic title [Default=filename or directory name]")
+ output_options.add_argument("--comicinfotitle", action="store_true", dest="comicinfotitle", default=False,
+ help="Write Title from ComicInfo.xml")
output_options.add_argument("-a", "--author", action="store", dest="author", default="defaultauthor",
help="Author name [Default=KCC]")
output_options.add_argument("-f", "--format", action="store", dest="format", default="Auto",