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:
@@ -620,7 +620,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
if value == 2:
|
||||
if profile['Label'] in ['KV', 'KO']:
|
||||
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.setChecked(True)
|
||||
else:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user