From 4ebd3e046d3e3589846dfc5d4049109b2f039f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Thu, 3 Oct 2013 19:20:59 +0200 Subject: [PATCH] Fixed Panel View generator bug (close #64) --- kcc/comic2ebook.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 4768c42..8764a5f 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -131,16 +131,20 @@ def buildHTML(path, imgfile): imgfilepv = string.join(imgfilepv, ".") else: imgfilepv = imgfile - xy = string.split(filename[0], "_kccx")[1] - x = string.split(xy, "_kccy")[0].lstrip("0") - y = string.split(xy, "_kccy")[1].lstrip("0") - if x != "": - x = "-" + str(float(x)/100) + "%" + if "_kccx" in filename[0]: + xy = string.split(filename[0], "_kccx")[1] + x = string.split(xy, "_kccy")[0].lstrip("0") + y = string.split(xy, "_kccy")[1].lstrip("0") + if x != "": + x = "-" + str(float(x)/100) + "%" + else: + x = "0%" + if y != "": + y = "-" + str(float(y)/100) + "%" + else: + y = "0%" else: x = "0%" - if y != "": - y = "-" + str(float(y)/100) + "%" - else: y = "0%" boxStyles = {"BoxTL": "left:" + x + ";top:" + y + ";", "BoxTR": "right:" + x + ";top:" + y + ";",