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

@@ -620,7 +620,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
if value == 2: if value == 2:
if profile['Label'] in ['KV', 'KO']: if profile['Label'] in ['KV', 'KO']:
self.addMessage('This option is intended for older Kindle models.', 'warning') self.addMessage('This option is intended for older Kindle models.', 'warning')
self.addMessage('It will not increase quality on a device with 300 ppi screen.', 'warning') self.addMessage('On this device, quality improvement will be negligible.', 'warning')
GUI.upscaleBox.setEnabled(False) GUI.upscaleBox.setEnabled(False)
GUI.upscaleBox.setChecked(True) GUI.upscaleBox.setChecked(True)
else: else:

View File

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