From bb24d3ca30baa900c0fd1e09de109b6202cf769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 29 Apr 2013 22:38:24 +0200 Subject: [PATCH 1/3] Preliminary support for horizontal Panel View. --- kcc/comic2ebook.py | 61 +++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 6be5da3..f4fa71c 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -70,26 +70,49 @@ def buildHTML(path, imgfile): imgfile, "\" class=\"singlePage\"/>\n" ]) if options.panelview: - if options.righttoleft: - f.writelines(["
\n", - "
\n", - "
\n", - "
\n" - ]) + if options.panelviewhorizontal: + if options.righttoleft: + f.writelines(["
\n", + "
\n", + "
\n", + "
\n" + ]) + else: + f.writelines(["
\n", + "
\n", + "
\n", + "
\n" + ]) else: - f.writelines(["
\n", - "
\n", - "
\n", - "
\n" - ]) + if options.righttoleft: + f.writelines(["
\n", + "
\n", + "
\n", + "
\n" + ]) + else: + f.writelines(["
\n", + "
\n", + "
\n", + "
\n" + ]) + f.writelines(["
\"",
\n", From 8b1965054f58d6fbf2f65f501895e22eecddf2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 7 May 2013 11:03:44 +0200 Subject: [PATCH 2/3] Added --panelviewhorizontal option --- kcc/comic2ebook.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index f4fa71c..5f1f12b 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -83,13 +83,13 @@ def buildHTML(path, imgfile): ]) else: f.writelines(["
\n", + "'{\"targetId\":\"BoxTL-Panel-Parent\", \"ordinal\":2}'>\n", "
\n", + "'{\"targetId\":\"BoxTR-Panel-Parent\", \"ordinal\":4}'>\n", "
\n", + "'{\"targetId\":\"BoxBL-Panel-Parent\", \"ordinal\":1}'>\n", "
\n" + "'{\"targetId\":\"BoxBR-Panel-Parent\", \"ordinal\":3}'>\n" ]) else: if options.righttoleft: @@ -618,6 +618,8 @@ def main(argv=None): help="Outputs a CBZ archive and does not generate EPUB") parser.add_option("--nopanelviewhq", action="store_true", dest="nopanelviewhq", default=False, help="Disable high quality Panel View [Default=False]") + parser.add_option("--panelviewhorizontal", action="store_true", dest="panelviewhorizontal", default=False, + help="Enable horizontal Panel View [Default=False]") parser.add_option("--noprocessing", action="store_false", dest="imgproc", default=True, help="Do not apply image preprocessing (Page splitting and optimizations) [Default=True]") parser.add_option("--forcepng", action="store_true", dest="forcepng", default=False, @@ -703,6 +705,8 @@ def checkOptions(): options.panelview = False if options.profile == 'K1' or options.profile == 'K2' or options.profile == 'KDX' or options.profile == 'KDXG': options.nopanelviewhq = True + if options.panelviewhorizontal: + options.panelview = True def getEpubPath(): From 8c579269789193c2c09a986a3d85a554b8bd6f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 7 May 2013 22:16:33 +0200 Subject: [PATCH 3/3] Disabling landscape mode as it is broken in this mode --- kcc/comic2ebook.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 5f1f12b..d0b6aa4 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -707,6 +707,7 @@ def checkOptions(): options.nopanelviewhq = True if options.panelviewhorizontal: options.panelview = True + options.landscapemode = False def getEpubPath():