1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

Fixed HQ mode upscaling (close #248)

This commit is contained in:
Paweł Jastrzębski
2017-10-13 10:41:45 +02:00
parent 458c28281f
commit f44bf5993e
2 changed files with 3 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ def buildHTML(path, imgfile, imgfilepath):
htmlfile = os.path.join(htmlpath, filename[0] + '.xhtml')
imgsize = Image.open(os.path.join(head, "Images", postfix, imgfile)).size
if options.hq:
imgsizeframe = deviceres
imgsizeframe = (int(imgsize[0] // 1.5), int(imgsize[1] // 1.5))
else:
imgsizeframe = imgsize
f = open(htmlfile, "w", encoding='UTF-8')
@@ -118,7 +118,7 @@ def buildHTML(path, imgfile, imgfilepath):
"content=\"width=" + str(imgsize[0]) + ", height=" + str(imgsize[1]) + "\"/>\n"
"</head>\n",
"<body style=\"" + additionalStyle + "\">\n",
"<div style=\"text-align:center;top:" + getTopMargin(deviceres, imgsize) + "%;\">\n",
"<div style=\"text-align:center;top:" + getTopMargin(deviceres, imgsizeframe) + "%;\">\n",
"<img width=\"" + str(imgsizeframe[0]) + "\" height=\"" + str(imgsizeframe[1]) + "\" ",
"src=\"", "../" * backref, "Images/", postfix, imgfile, "\"/>\n</div>\n"])
if options.iskindle and options.panelview: