mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 17:56:30 +00:00
Web...toon mode improvements
This commit is contained in:
@@ -99,7 +99,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="WebstripBox">
|
<widget class="QCheckBox" name="WebtoonBox">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>11</pointsize>
|
<pointsize>11</pointsize>
|
||||||
@@ -109,10 +109,10 @@
|
|||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html></string>
|
<string><html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webtoons like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Pages with a low width, high height and vertical panel flow.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Webstrip mode</string>
|
<string>Webtoon mode</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
6
KCC.ui
6
KCC.ui
@@ -92,15 +92,15 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="WebstripBox">
|
<widget class="QCheckBox" name="WebtoonBox">
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html></string>
|
<string><html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webtoons like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Pages with a low width, high height and vertical panel flow.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Webstrip mode</string>
|
<string>Webtoon mode</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Options:
|
|||||||
-m, --manga-style Manga style (Right-to-left reading and splitting)
|
-m, --manga-style Manga style (Right-to-left reading and splitting)
|
||||||
|
|
||||||
EXPERIMENTAL:
|
EXPERIMENTAL:
|
||||||
-w, --webstrip Webstrip processing mode
|
-w, --webtoon Webtoon processing mode
|
||||||
|
|
||||||
OUTPUT SETTINGS:
|
OUTPUT SETTINGS:
|
||||||
-o OUTPUT, --output=OUTPUT
|
-o OUTPUT, --output=OUTPUT
|
||||||
@@ -249,7 +249,7 @@ The app relies and includes the following scripts/binaries:
|
|||||||
|
|
||||||
####3.2:
|
####3.2:
|
||||||
* Too big EPUB files are now splitted before conversion to MOBI
|
* Too big EPUB files are now splitted before conversion to MOBI
|
||||||
* Added experimental parser of manga webstrips
|
* Added experimental parser of manga webtoons
|
||||||
* Improved error handling
|
* Improved error handling
|
||||||
|
|
||||||
## KNOWN ISSUES
|
## KNOWN ISSUES
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ class WorkerThread(QtCore.QThread):
|
|||||||
argv.append("--upscale")
|
argv.append("--upscale")
|
||||||
if GUI.NoDitheringBox.isChecked():
|
if GUI.NoDitheringBox.isChecked():
|
||||||
argv.append("--forcepng")
|
argv.append("--forcepng")
|
||||||
if GUI.WebstripBox.isChecked():
|
if GUI.WebtoonBox.isChecked():
|
||||||
argv.append("--webstrip")
|
argv.append("--webtoon")
|
||||||
if float(self.parent.GammaValue) > 0.09:
|
if float(self.parent.GammaValue) > 0.09:
|
||||||
argv.append("--gamma=" + self.parent.GammaValue)
|
argv.append("--gamma=" + self.parent.GammaValue)
|
||||||
if str(GUI.FormatBox.currentText()) == 'CBZ':
|
if str(GUI.FormatBox.currentText()) == 'CBZ':
|
||||||
@@ -429,16 +429,17 @@ class Ui_KCC(object):
|
|||||||
GUI.GammaLabel.setText('Gamma: ' + str(value))
|
GUI.GammaLabel.setText('Gamma: ' + str(value))
|
||||||
self.GammaValue = value
|
self.GammaValue = value
|
||||||
|
|
||||||
def toggleWebstripBox(self, value):
|
def toggleWebtoonBox(self, value):
|
||||||
if value:
|
if value:
|
||||||
GUI.RotateBox.setEnabled(False)
|
GUI.NoRotateBox.setEnabled(False)
|
||||||
GUI.RotateBox.setChecked(True)
|
GUI.NoRotateBox.setChecked(True)
|
||||||
GUI.QualityBox.setEnabled(False)
|
GUI.QualityBox.setEnabled(False)
|
||||||
GUI.QualityBox.setChecked(False)
|
GUI.QualityBox.setChecked(False)
|
||||||
GUI.BorderBox.setEnabled(False)
|
GUI.BorderBox.setEnabled(False)
|
||||||
GUI.BorderBox.setChecked(False)
|
GUI.BorderBox.setChecked(False)
|
||||||
|
self.addMessage('If images are color setting <i>Gamma</i> to 1.0 is recommended.', 'info')
|
||||||
else:
|
else:
|
||||||
GUI.RotateBox.setEnabled(True)
|
GUI.NoRotateBox.setEnabled(True)
|
||||||
GUI.QualityBox.setEnabled(True)
|
GUI.QualityBox.setEnabled(True)
|
||||||
GUI.BorderBox.setEnabled(True)
|
GUI.BorderBox.setEnabled(True)
|
||||||
|
|
||||||
@@ -544,7 +545,7 @@ class Ui_KCC(object):
|
|||||||
'UpscaleBox': GUI.UpscaleBox.checkState(),
|
'UpscaleBox': GUI.UpscaleBox.checkState(),
|
||||||
'NoRotateBox': GUI.NoRotateBox.checkState(),
|
'NoRotateBox': GUI.NoRotateBox.checkState(),
|
||||||
'BorderBox': GUI.BorderBox.checkState(),
|
'BorderBox': GUI.BorderBox.checkState(),
|
||||||
'WebstripBox': GUI.WebstripBox.checkState(),
|
'WebtoonBox': GUI.WebtoonBox.checkState(),
|
||||||
'NoDitheringBox': GUI.NoDitheringBox.checkState(),
|
'NoDitheringBox': GUI.NoDitheringBox.checkState(),
|
||||||
'ColorBox': GUI.ColorBox.checkState(),
|
'ColorBox': GUI.ColorBox.checkState(),
|
||||||
'customWidth': GUI.customWidth.text(),
|
'customWidth': GUI.customWidth.text(),
|
||||||
@@ -606,7 +607,7 @@ class Ui_KCC(object):
|
|||||||
GUI.ConvertButton.clicked.connect(self.convertStart)
|
GUI.ConvertButton.clicked.connect(self.convertStart)
|
||||||
GUI.GammaSlider.valueChanged.connect(self.changeGamma)
|
GUI.GammaSlider.valueChanged.connect(self.changeGamma)
|
||||||
GUI.NoRotateBox.stateChanged.connect(self.toggleNoSplitRotate)
|
GUI.NoRotateBox.stateChanged.connect(self.toggleNoSplitRotate)
|
||||||
GUI.WebstripBox.stateChanged.connect(self.toggleWebstripBox)
|
GUI.WebtoonBox.stateChanged.connect(self.toggleWebtoonBox)
|
||||||
GUI.DeviceBox.activated.connect(self.changeDevice)
|
GUI.DeviceBox.activated.connect(self.changeDevice)
|
||||||
KCC.connect(self.worker, QtCore.SIGNAL("progressBarTick"), self.updateProgressbar)
|
KCC.connect(self.worker, QtCore.SIGNAL("progressBarTick"), self.updateProgressbar)
|
||||||
KCC.connect(self.worker, QtCore.SIGNAL("modeConvert"), self.modeConvert)
|
KCC.connect(self.worker, QtCore.SIGNAL("modeConvert"), self.modeConvert)
|
||||||
@@ -639,7 +640,7 @@ class Ui_KCC(object):
|
|||||||
elif str(option) == "GammaSlider":
|
elif str(option) == "GammaSlider":
|
||||||
GUI.GammaSlider.setValue(int(self.options[option]))
|
GUI.GammaSlider.setValue(int(self.options[option]))
|
||||||
self.changeGamma(int(self.options[option]))
|
self.changeGamma(int(self.options[option]))
|
||||||
elif str(option) == "StretchBox":
|
elif str(option) == "StretchBox" or str(option) == "WebstripBox":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
eval('GUI.' + str(option)).setCheckState(self.options[option])
|
eval('GUI.' + str(option)).setCheckState(self.options[option])
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'KCC.ui'
|
# Form implementation generated from reading ui file 'KCC.ui'
|
||||||
#
|
#
|
||||||
# Created: Mon Aug 12 13:54:39 2013
|
# Created: Wed Aug 14 08:39:46 2013
|
||||||
# by: PyQt4 UI code generator 4.10.2
|
# by: PyQt4 UI code generator 4.10.2
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@@ -58,10 +58,10 @@ class Ui_KCC(object):
|
|||||||
self.UpscaleBox.setTristate(True)
|
self.UpscaleBox.setTristate(True)
|
||||||
self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox"))
|
self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox"))
|
||||||
self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1)
|
self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1)
|
||||||
self.WebstripBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
self.WebtoonBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
||||||
self.WebstripBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
self.WebtoonBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||||
self.WebstripBox.setObjectName(_fromUtf8("WebstripBox"))
|
self.WebtoonBox.setObjectName(_fromUtf8("WebtoonBox"))
|
||||||
self.gridLayout.addWidget(self.WebstripBox, 3, 1, 1, 1)
|
self.gridLayout.addWidget(self.WebtoonBox, 3, 1, 1, 1)
|
||||||
self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
||||||
self.NoDitheringBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
self.NoDitheringBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||||
self.NoDitheringBox.setObjectName(_fromUtf8("NoDitheringBox"))
|
self.NoDitheringBox.setObjectName(_fromUtf8("NoDitheringBox"))
|
||||||
@@ -266,8 +266,8 @@ class Ui_KCC(object):
|
|||||||
self.ProcessingBox.setText(_translate("KCC", "No optimisation", None))
|
self.ProcessingBox.setText(_translate("KCC", "No optimisation", None))
|
||||||
self.UpscaleBox.setToolTip(_translate("KCC", "<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>", None))
|
self.UpscaleBox.setToolTip(_translate("KCC", "<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>", None))
|
||||||
self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None))
|
self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None))
|
||||||
self.WebstripBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-weight:600;\">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=\" font-style:italic;\">Tower of God</span> or <span style=\" font-style:italic;\">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html>", None))
|
self.WebtoonBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-weight:600;\">EXPERIMENTAL!<br/></span>Enable auto-splitting of webtoons like <span style=\" font-style:italic;\">Tower of God</span> or <span style=\" font-style:italic;\">Noblesse</span>.<br/>Pages with a low width, high height and vertical panel flow.</p></body></html>", None))
|
||||||
self.WebstripBox.setText(_translate("KCC", "Webstrip mode", None))
|
self.WebtoonBox.setText(_translate("KCC", "Webtoon mode", None))
|
||||||
self.NoDitheringBox.setToolTip(_translate("KCC", "<html><head/><body><p>Create PNG files instead JPEG.<br/><span style=\" font-weight:600;\">Only for non-Kindle devices!</span></p></body></html>", None))
|
self.NoDitheringBox.setToolTip(_translate("KCC", "<html><head/><body><p>Create PNG files instead JPEG.<br/><span style=\" font-weight:600;\">Only for non-Kindle devices!</span></p></body></html>", None))
|
||||||
self.NoDitheringBox.setText(_translate("KCC", "PNG output", None))
|
self.NoDitheringBox.setText(_translate("KCC", "PNG output", None))
|
||||||
self.BorderBox.setToolTip(_translate("KCC", "Fill space around images with black color.", None))
|
self.BorderBox.setToolTip(_translate("KCC", "Fill space around images with black color.", None))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'KCC-OSX.ui'
|
# Form implementation generated from reading ui file 'KCC-OSX.ui'
|
||||||
#
|
#
|
||||||
# Created: Mon Aug 12 13:54:37 2013
|
# Created: Wed Aug 14 08:39:45 2013
|
||||||
# by: PyQt4 UI code generator 4.10.2
|
# by: PyQt4 UI code generator 4.10.2
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@@ -63,13 +63,13 @@ class Ui_KCC(object):
|
|||||||
self.UpscaleBox.setTristate(True)
|
self.UpscaleBox.setTristate(True)
|
||||||
self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox"))
|
self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox"))
|
||||||
self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1)
|
self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1)
|
||||||
self.WebstripBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
self.WebtoonBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(11)
|
font.setPointSize(11)
|
||||||
self.WebstripBox.setFont(font)
|
self.WebtoonBox.setFont(font)
|
||||||
self.WebstripBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
self.WebtoonBox.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||||
self.WebstripBox.setObjectName(_fromUtf8("WebstripBox"))
|
self.WebtoonBox.setObjectName(_fromUtf8("WebtoonBox"))
|
||||||
self.gridLayout.addWidget(self.WebstripBox, 3, 1, 1, 1)
|
self.gridLayout.addWidget(self.WebtoonBox, 3, 1, 1, 1)
|
||||||
self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(11)
|
font.setPointSize(11)
|
||||||
@@ -324,8 +324,8 @@ class Ui_KCC(object):
|
|||||||
self.ProcessingBox.setText(_translate("KCC", "No optimisation", None))
|
self.ProcessingBox.setText(_translate("KCC", "No optimisation", None))
|
||||||
self.UpscaleBox.setToolTip(_translate("KCC", "<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>", None))
|
self.UpscaleBox.setToolTip(_translate("KCC", "<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>", None))
|
||||||
self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None))
|
self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None))
|
||||||
self.WebstripBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-weight:600;\">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=\" font-style:italic;\">Tower of God</span> or <span style=\" font-style:italic;\">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html>", None))
|
self.WebtoonBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-weight:600;\">EXPERIMENTAL!<br/></span>Enable auto-splitting of webtoons like <span style=\" font-style:italic;\">Tower of God</span> or <span style=\" font-style:italic;\">Noblesse</span>.<br/>Pages with a low width, high height and vertical panel flow.</p></body></html>", None))
|
||||||
self.WebstripBox.setText(_translate("KCC", "Webstrip mode", None))
|
self.WebtoonBox.setText(_translate("KCC", "Webtoon mode", None))
|
||||||
self.NoDitheringBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-size:12pt;\">Create PNG files instead JPEG.<br/></span><span style=\" font-size:12pt; font-weight:600;\">Only for non-Kindle devices!</span></p></body></html>", None))
|
self.NoDitheringBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-size:12pt;\">Create PNG files instead JPEG.<br/></span><span style=\" font-size:12pt; font-weight:600;\">Only for non-Kindle devices!</span></p></body></html>", None))
|
||||||
self.NoDitheringBox.setText(_translate("KCC", "PNG output", None))
|
self.NoDitheringBox.setText(_translate("KCC", "PNG output", None))
|
||||||
self.BorderBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-size:12pt;\">Fill space around images with black color.</span></p></body></html>", None))
|
self.BorderBox.setToolTip(_translate("KCC", "<html><head/><body><p><span style=\" font-size:12pt;\">Fill space around images with black color.</span></p></body></html>", None))
|
||||||
|
|||||||
@@ -323,9 +323,9 @@ def getImageFileName(imgfile):
|
|||||||
|
|
||||||
|
|
||||||
def applyImgOptimization(img, isSplit, toRight, options, overrideQuality=5):
|
def applyImgOptimization(img, isSplit, toRight, options, overrideQuality=5):
|
||||||
if not options.webstrip:
|
if not options.webtoon:
|
||||||
img.cropWhiteSpace(10.0)
|
img.cropWhiteSpace(10.0)
|
||||||
if options.cutpagenumbers and not options.webstrip:
|
if options.cutpagenumbers and not options.webtoon:
|
||||||
img.cutPageNumber()
|
img.cutPageNumber()
|
||||||
img.optimizeImage(options.gamma)
|
img.optimizeImage(options.gamma)
|
||||||
if overrideQuality != 5:
|
if overrideQuality != 5:
|
||||||
@@ -849,8 +849,8 @@ def main(argv=None, qtGUI=None):
|
|||||||
help="Outputs a CBZ archive and does not generate EPUB")
|
help="Outputs a CBZ archive and does not generate EPUB")
|
||||||
outputOptions.add_option("--batchsplit", action="store_true", dest="batchsplit", default=False,
|
outputOptions.add_option("--batchsplit", action="store_true", dest="batchsplit", default=False,
|
||||||
help="Split output into multiple files"),
|
help="Split output into multiple files"),
|
||||||
experimentalOptions.add_option("-w", "--webstrip", action="store_true", dest="webstrip", default=False,
|
experimentalOptions.add_option("-w", "--webtoon", action="store_true", dest="webtoon", default=False,
|
||||||
help="Webstrip processing mode"),
|
help="Webtoon processing mode"),
|
||||||
processingOptions.add_option("--blackborders", action="store_true", dest="black_borders", default=False,
|
processingOptions.add_option("--blackborders", action="store_true", dest="black_borders", default=False,
|
||||||
help="Use black borders instead of white ones")
|
help="Use black borders instead of white ones")
|
||||||
processingOptions.add_option("--forcecolor", action="store_true", dest="forcecolor", default=False,
|
processingOptions.add_option("--forcecolor", action="store_true", dest="forcecolor", default=False,
|
||||||
@@ -896,7 +896,7 @@ def main(argv=None, qtGUI=None):
|
|||||||
parser.print_help()
|
parser.print_help()
|
||||||
return
|
return
|
||||||
path = getWorkFolder(args[0])
|
path = getWorkFolder(args[0])
|
||||||
if options.webstrip:
|
if options.webtoon:
|
||||||
if GUI:
|
if GUI:
|
||||||
GUI.emit(QtCore.SIGNAL("progressBarTick"), 'status', 'Splitting images')
|
GUI.emit(QtCore.SIGNAL("progressBarTick"), 'status', 'Splitting images')
|
||||||
if options.customheight > 0:
|
if options.customheight > 0:
|
||||||
@@ -967,9 +967,9 @@ def getOutputFilename(srcpath, wantedname, ext, tomeNumber):
|
|||||||
|
|
||||||
def checkOptions():
|
def checkOptions():
|
||||||
global options
|
global options
|
||||||
# Webstrip mode mandatory options
|
# Webtoon mode mandatory options
|
||||||
if options.webstrip:
|
if options.webtoon:
|
||||||
options.rotate = True
|
options.nosplitrotate = True
|
||||||
options.black_borders = False
|
options.black_borders = False
|
||||||
options.quality = 0
|
options.quality = 0
|
||||||
# Landscape mode is only supported by Kindle Touch and Paperwhite.
|
# Landscape mode is only supported by Kindle Touch and Paperwhite.
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ def splitImage(work):
|
|||||||
name = work[1]
|
name = work[1]
|
||||||
options = splitImage.options
|
options = splitImage.options
|
||||||
# Harcoded options
|
# Harcoded options
|
||||||
threshold = 10.0
|
threshold = 0.5
|
||||||
delta = 10
|
delta = 15
|
||||||
print ".",
|
print ".",
|
||||||
splitImage.queue.put(".")
|
splitImage.queue.put(".")
|
||||||
fileExpanded = os.path.splitext(name)
|
fileExpanded = os.path.splitext(name)
|
||||||
@@ -126,7 +126,7 @@ def splitImage(work):
|
|||||||
|
|
||||||
# Find panels
|
# Find panels
|
||||||
y1 = 0
|
y1 = 0
|
||||||
y2 = 10
|
y2 = 15
|
||||||
panels = []
|
panels = []
|
||||||
while y2 < heightImg:
|
while y2 < heightImg:
|
||||||
while ImageStat.Stat(image.crop([0, y1, widthImg, y2])).var[0] < threshold and y2 < heightImg:
|
while ImageStat.Stat(image.crop([0, y1, widthImg, y2])).var[0] < threshold and y2 < heightImg:
|
||||||
@@ -178,6 +178,7 @@ def splitImage(work):
|
|||||||
targetHeight = 0
|
targetHeight = 0
|
||||||
for panel in page:
|
for panel in page:
|
||||||
pageHeight += panels[panel][2]
|
pageHeight += panels[panel][2]
|
||||||
|
if pageHeight > delta:
|
||||||
newPage = Image.new('RGB', (widthImg, pageHeight))
|
newPage = Image.new('RGB', (widthImg, pageHeight))
|
||||||
for panel in page:
|
for panel in page:
|
||||||
panelImg = image.crop([0, panels[panel][0], widthImg, panels[panel][1]])
|
panelImg = image.crop([0, panels[panel][0], widthImg, panels[panel][1]])
|
||||||
|
|||||||
Reference in New Issue
Block a user