diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py
index 9580dab..404ca11 100755
--- a/kindlecomicconverter/comic2ebook.py
+++ b/kindlecomicconverter/comic2ebook.py
@@ -106,6 +106,7 @@ def buildHTML(path, imgfile, imgfilepath):
if not os.path.exists(htmlpath):
os.makedirs(htmlpath)
htmlfile = os.path.join(htmlpath, filename[0] + '.xhtml')
+ imgsize = Image.open(os.path.join(head, "Images", postfix, imgfile)).size
f = open(htmlfile, "w", encoding='UTF-8')
f.writelines(["\n",
"\n",
@@ -116,14 +117,15 @@ def buildHTML(path, imgfile, imgfilepath):
"\n"
"\n",
- "
\n"])
+ "\n",
+ "\n",
+ "
![]()
\n
\n"])
if options.iskindle and options.panelview:
- sizeTmp = Image.open(os.path.join(head, "Images", postfix, imgfile)).size
if options.autoscale:
- size = (getPanelViewResolution(sizeTmp, deviceres))
+ size = (getPanelViewResolution(imgsize, deviceres))
else:
- size = (int(sizeTmp[0] * 1.5), int(sizeTmp[1] * 1.5))
+ size = (int(imgsize[0] * 1.5), int(imgsize[1] * 1.5))
if size[0] - deviceres[0] < deviceres[0] * 0.01:
noHorizontalPV = True
else:
@@ -356,9 +358,6 @@ def buildEPUB(path, chapterNames, tomeNumber):
"display: block;\n",
"margin: 0;\n",
"padding: 0;\n",
- "background-position: center center;\n",
- "background-repeat: no-repeat;\n",
- "background-size: auto auto;\n",
"}\n",
"#PV {\n",
"position: absolute;\n",
@@ -671,6 +670,11 @@ def getDirectorySize(start_path='.'):
return total_size
+def getTopMargin(deviceres, size):
+ y = int((deviceres[1] - size[1]) / 2) / deviceres[1] * 100
+ return str(round(y, 1))
+
+
def getPanelViewResolution(imageSize, deviceRes):
scale = float(deviceRes[0]) / float(imageSize[0])
return int(deviceRes[0]), int(scale * imageSize[1])