mirror of
https://github.com/ciromattia/kcc
synced 2026-10-19 16:02:33 +00:00
add --nosplitrotate option (is the name right?)
This commit is contained in:
+6
-1
@@ -277,7 +277,10 @@ def dirImgProcess(path):
|
|||||||
else:
|
else:
|
||||||
print ".",
|
print ".",
|
||||||
img = image.ComicPage(os.path.join(dirpath, afile), options.profile)
|
img = image.ComicPage(os.path.join(dirpath, afile), options.profile)
|
||||||
split = img.splitPage(dirpath, options.righttoleft, options.rotate)
|
if options.nosplitrotate:
|
||||||
|
split = None
|
||||||
|
else:
|
||||||
|
split = img.splitPage(dirpath, options.righttoleft, options.rotate)
|
||||||
if split is not None:
|
if split is not None:
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
print "Splitted " + afile
|
print "Splitted " + afile
|
||||||
@@ -407,6 +410,8 @@ def main(argv=None):
|
|||||||
+ "is not like the device's one [default=False]")
|
+ "is not like the device's one [default=False]")
|
||||||
parser.add_option("--no-cut-page-numbers", action="store_false", dest="cutpagenumbers", default=True,
|
parser.add_option("--no-cut-page-numbers", action="store_false", dest="cutpagenumbers", default=True,
|
||||||
help="Do not try to cut page numbering on images [default=True]")
|
help="Do not try to cut page numbering on images [default=True]")
|
||||||
|
parser.add_option("--nosplitrotate", action="store_true", dest="nosplitrotate", default=False,
|
||||||
|
help="Disable splitting and rotation [default=False]")
|
||||||
parser.add_option("--rotate", action="store_true", dest="rotate", default=False,
|
parser.add_option("--rotate", action="store_true", dest="rotate", default=False,
|
||||||
help="Rotate landscape pages instead of splitting them [default=False]")
|
help="Rotate landscape pages instead of splitting them [default=False]")
|
||||||
parser.add_option("-o", "--output", action="store", dest="output", default=None,
|
parser.add_option("-o", "--output", action="store", dest="output", default=None,
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class MainWindow:
|
|||||||
self.options = {
|
self.options = {
|
||||||
'epub_only': IntVar(None, 0),
|
'epub_only': IntVar(None, 0),
|
||||||
'image_preprocess': IntVar(None, 1),
|
'image_preprocess': IntVar(None, 1),
|
||||||
|
'nosplitrotate': IntVar(None, 0),
|
||||||
'rotate': IntVar(None, 0),
|
'rotate': IntVar(None, 0),
|
||||||
'cut_page_numbers': IntVar(None, 1),
|
'cut_page_numbers': IntVar(None, 1),
|
||||||
'mangastyle': IntVar(None, 0),
|
'mangastyle': IntVar(None, 0),
|
||||||
@@ -100,6 +101,7 @@ class MainWindow:
|
|||||||
self.optionlabels = {
|
self.optionlabels = {
|
||||||
'epub_only': "Generate ePub only (does not call 'kindlegen')",
|
'epub_only': "Generate ePub only (does not call 'kindlegen')",
|
||||||
'image_preprocess': "Apply image optimizations",
|
'image_preprocess': "Apply image optimizations",
|
||||||
|
'nosplitrotate': "Disable splitting and rotation",
|
||||||
'rotate': "Rotate landscape images instead of splitting them",
|
'rotate': "Rotate landscape images instead of splitting them",
|
||||||
'cut_page_numbers': "Cut page numbers",
|
'cut_page_numbers': "Cut page numbers",
|
||||||
'mangastyle': "Manga-style (right-to-left reading, applies to reading and splitting)",
|
'mangastyle': "Manga-style (right-to-left reading, applies to reading and splitting)",
|
||||||
@@ -140,6 +142,8 @@ class MainWindow:
|
|||||||
argv = ["-p", profilekey]
|
argv = ["-p", profilekey]
|
||||||
if self.options['image_preprocess'].get() == 0:
|
if self.options['image_preprocess'].get() == 0:
|
||||||
argv.append("--no-image-processing")
|
argv.append("--no-image-processing")
|
||||||
|
if self.options['nosplitrotate'].get() == 1:
|
||||||
|
argv.append("--nosplitrotate")
|
||||||
if self.options['rotate'].get() == 1:
|
if self.options['rotate'].get() == 1:
|
||||||
argv.append("--rotate")
|
argv.append("--rotate")
|
||||||
if self.options['cut_page_numbers'].get() == 0:
|
if self.options['cut_page_numbers'].get() == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user