mirror of
https://github.com/ciromattia/kcc
synced 2026-06-15 02:50:42 +00:00
smart cover crop is default off (#1331)
This commit is contained in:
@@ -269,7 +269,7 @@ PROCESSING:
|
|||||||
Crop empty sections. 0: Disabled 1: Horizontally 2: Both [Default=0]
|
Crop empty sections. 0: Disabled 1: Horizontally 2: Both [Default=0]
|
||||||
--blackborders Disable autodetection and force black borders
|
--blackborders Disable autodetection and force black borders
|
||||||
--whiteborders Disable autodetection and force white borders
|
--whiteborders Disable autodetection and force white borders
|
||||||
--nosmartcovercrop Disable attempt to crop main cover from wide image
|
--smartcovercrop Attempt to crop main cover from wide image
|
||||||
--coverfill Center-crop only the cover to fill target device screen
|
--coverfill Center-crop only the cover to fill target device screen
|
||||||
--forcecolor Don't convert images to grayscale
|
--forcecolor Don't convert images to grayscale
|
||||||
--forcepng Create PNG files instead JPEG for black and white images
|
--forcepng Create PNG files instead JPEG for black and white images
|
||||||
|
|||||||
+3
-3
@@ -655,12 +655,12 @@ Higher values are larger and higher quality, and may resolve blank page issues.<
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="QCheckBox" name="noSmartCoverCropBox">
|
<widget class="QCheckBox" name="smartCoverCropBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Disable attempt to crop main cover from wide image.</string>
|
<string><html><head/><body><p>Attempt to crop main cover from wide image.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>No Smart Cover Crop</string>
|
<string>Smart Cover Crop</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -331,8 +331,8 @@ class WorkerThread(QThread):
|
|||||||
options.pdfextract = True
|
options.pdfextract = True
|
||||||
if GUI.pdfWidthBox.isChecked():
|
if GUI.pdfWidthBox.isChecked():
|
||||||
options.pdfwidth = True
|
options.pdfwidth = True
|
||||||
if GUI.noSmartCoverCropBox.isChecked():
|
if GUI.smartCoverCropBox.isChecked():
|
||||||
options.nosmartcovercrop = True
|
options.smartcovercrop = True
|
||||||
if GUI.coverFillBox.isChecked():
|
if GUI.coverFillBox.isChecked():
|
||||||
options.coverfill = True
|
options.coverfill = True
|
||||||
if GUI.metadataTitleBox.checkState() == Qt.CheckState.PartiallyChecked:
|
if GUI.metadataTitleBox.checkState() == Qt.CheckState.PartiallyChecked:
|
||||||
@@ -1085,7 +1085,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
'disableProcessingBox': GUI.disableProcessingBox.checkState(),
|
'disableProcessingBox': GUI.disableProcessingBox.checkState(),
|
||||||
'pdfExtractBox': GUI.pdfExtractBox.checkState(),
|
'pdfExtractBox': GUI.pdfExtractBox.checkState(),
|
||||||
'pdfWidthBox': GUI.pdfWidthBox.checkState(),
|
'pdfWidthBox': GUI.pdfWidthBox.checkState(),
|
||||||
'noSmartCoverCropBox': GUI.noSmartCoverCropBox.checkState(),
|
'smartCoverCropBox': GUI.smartCoverCropBox.checkState(),
|
||||||
'coverFillBox': GUI.coverFillBox.checkState(),
|
'coverFillBox': GUI.coverFillBox.checkState(),
|
||||||
'metadataTitleBox': GUI.metadataTitleBox.checkState(),
|
'metadataTitleBox': GUI.metadataTitleBox.checkState(),
|
||||||
'mozJpegBox': GUI.mozJpegBox.checkState(),
|
'mozJpegBox': GUI.mozJpegBox.checkState(),
|
||||||
|
|||||||
@@ -344,10 +344,10 @@ class Ui_mainWindow(object):
|
|||||||
|
|
||||||
self.gridLayout_2.addWidget(self.metadataTitleBox, 7, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.metadataTitleBox, 7, 0, 1, 1)
|
||||||
|
|
||||||
self.noSmartCoverCropBox = QCheckBox(self.optionWidget)
|
self.smartCoverCropBox = QCheckBox(self.optionWidget)
|
||||||
self.noSmartCoverCropBox.setObjectName(u"noSmartCoverCropBox")
|
self.smartCoverCropBox.setObjectName(u"smartCoverCropBox")
|
||||||
|
|
||||||
self.gridLayout_2.addWidget(self.noSmartCoverCropBox, 11, 1, 1, 1)
|
self.gridLayout_2.addWidget(self.smartCoverCropBox, 11, 1, 1, 1)
|
||||||
|
|
||||||
self.rotateFirstBox = QCheckBox(self.optionWidget)
|
self.rotateFirstBox = QCheckBox(self.optionWidget)
|
||||||
self.rotateFirstBox.setObjectName(u"rotateFirstBox")
|
self.rotateFirstBox.setObjectName(u"rotateFirstBox")
|
||||||
@@ -753,9 +753,9 @@ class Ui_mainWindow(object):
|
|||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
self.metadataTitleBox.setText(QCoreApplication.translate("mainWindow", u"Metadata Title", None))
|
self.metadataTitleBox.setText(QCoreApplication.translate("mainWindow", u"Metadata Title", None))
|
||||||
#if QT_CONFIG(tooltip)
|
#if QT_CONFIG(tooltip)
|
||||||
self.noSmartCoverCropBox.setToolTip(QCoreApplication.translate("mainWindow", u"Disable attempt to crop main cover from wide image.", None))
|
self.smartCoverCropBox.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p>Attempt to crop main cover from wide image.</p></body></html>", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
self.noSmartCoverCropBox.setText(QCoreApplication.translate("mainWindow", u"No Smart Cover Crop", None))
|
self.smartCoverCropBox.setText(QCoreApplication.translate("mainWindow", u"Smart Cover Crop", None))
|
||||||
#if QT_CONFIG(tooltip)
|
#if QT_CONFIG(tooltip)
|
||||||
self.rotateFirstBox.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p>When the spread splitter option is partially checked,</p><p><span style=\" font-weight:600; text-decoration: underline;\">Unchecked - Rotate Last<br/></span>Put the rotated 2 page spread after the split spreads.</p><p><span style=\" font-weight:600; text-decoration: underline;\">Checked - Rotate First<br/></span>Put the rotated 2 page spread before the split spreads.</p></body></html>", None))
|
self.rotateFirstBox.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p>When the spread splitter option is partially checked,</p><p><span style=\" font-weight:600; text-decoration: underline;\">Unchecked - Rotate Last<br/></span>Put the rotated 2 page spread after the split spreads.</p><p><span style=\" font-weight:600; text-decoration: underline;\">Checked - Rotate First<br/></span>Put the rotated 2 page spread before the split spreads.</p></body></html>", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
|||||||
@@ -1406,8 +1406,8 @@ def makeParser():
|
|||||||
help="Use the legacy PDF image extraction method from KCC 8 and earlier")
|
help="Use the legacy PDF image extraction method from KCC 8 and earlier")
|
||||||
processing_options.add_argument("--pdfwidth", action="store_true", dest="pdfwidth", default=False,
|
processing_options.add_argument("--pdfwidth", action="store_true", dest="pdfwidth", default=False,
|
||||||
help="Render vector PDFs to device width instead of height.")
|
help="Render vector PDFs to device width instead of height.")
|
||||||
processing_options.add_argument("--nosmartcovercrop", action="store_true", dest="nosmartcovercrop", default=False,
|
processing_options.add_argument("--smartcovercrop", action="store_true", dest="smartcovercrop", default=False,
|
||||||
help="Disable attempt to crop main cover from wide image")
|
help="Attempt to crop main cover from wide image")
|
||||||
processing_options.add_argument("--coverfill", action="store_true", dest="coverfill", default=False,
|
processing_options.add_argument("--coverfill", action="store_true", dest="coverfill", default=False,
|
||||||
help="Crop cover to fill screen")
|
help="Crop cover to fill screen")
|
||||||
processing_options.add_argument("-u", "--upscale", action="store_true", dest="upscale", default=False,
|
processing_options.add_argument("-u", "--upscale", action="store_true", dest="upscale", default=False,
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ class Cover:
|
|||||||
self.image = ImageOps.autocontrast(self.image, preserve_tone=True)
|
self.image = ImageOps.autocontrast(self.image, preserve_tone=True)
|
||||||
if not self.options.forcecolor:
|
if not self.options.forcecolor:
|
||||||
self.image = self.image.convert('L')
|
self.image = self.image.convert('L')
|
||||||
if not self.options.nosmartcovercrop:
|
if self.options.smartcovercrop:
|
||||||
self.crop_main_cover()
|
self.crop_main_cover()
|
||||||
|
|
||||||
size = list(self.options.profileData[1])
|
size = list(self.options.profileData[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user