mirror of
https://github.com/ciromattia/kcc
synced 2026-10-20 16:32:31 +00:00
add custom fixed resolutions
This commit is contained in:
@@ -275,7 +275,9 @@ MANDATORY:
|
|||||||
|
|
||||||
MAIN:
|
MAIN:
|
||||||
-p PROFILE, --profile PROFILE
|
-p PROFILE, --profile PROFILE
|
||||||
Device profile (Available options: K1, K2, K34, K578, KDX, KPW, KPW5, KV, KO, K11, KS, KoMT, KoG, KoGHD, KoA, KoAHD, KoAH2O, KoAO, KoN, KoC, KoCC, KoL, KoLC, KoF, KoS, KoE)
|
Device profile (Available options: K1, K2, KDX, K34, K57, KPW, KV, KPW34, K810, KO, K11, KPW5, KPW6, KS1860, KS1920,
|
||||||
|
KS1240, KS1324, KS, KCS, KS3, KSCS, KoMT, KoG, KoGHD, KoA, KoAHD, KoAH2O, KoAO, KoN, KoC, KoCC, KoL, KoLC, KoF, KoS, KoE,
|
||||||
|
Rmk1, Rmk2, RmkPP, RmkPPMove, OTHER, 1072x1448, 1264x1680, 1404x1872, 1536x2048, 1650x2200, 1860x2480, 2400x3200)
|
||||||
[Default=KV]
|
[Default=KV]
|
||||||
-m, --manga-style Manga style (right-to-left reading and splitting)
|
-m, --manga-style Manga style (right-to-left reading and splitting)
|
||||||
--lightnovel Only resize images and preserve original file structure.
|
--lightnovel Only resize images and preserve original file structure.
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ from PIL.Image import Dither
|
|||||||
from .KCC_spread_label import LabelSpreadsDialog
|
from .KCC_spread_label import LabelSpreadsDialog
|
||||||
|
|
||||||
from .shared import HTMLStripper, sanitizeTrace, walkLevel
|
from .shared import HTMLStripper, sanitizeTrace, walkLevel
|
||||||
|
from .image import ProfileData
|
||||||
from .comicarchive import SEVENZIP, TAR, available_archive_tools
|
from .comicarchive import SEVENZIP, TAR, available_archive_tools
|
||||||
from .comic2ebook import OS_SORT_KEY, KF7_KINDLES, flattenTree, getWorkFolder, removeNonImages, sanitizeTree, detectKindleGen
|
from .comic2ebook import OS_SORT_KEY, KF7_KINDLES, flattenTree, getWorkFolder, removeNonImages, sanitizeTree, detectKindleGen
|
||||||
from . import __version__
|
from . import __version__
|
||||||
@@ -1649,15 +1650,20 @@ class KCCGUI(QObject, KCC_ui.Ui_mainWindow):
|
|||||||
'Label': 'KoS'},
|
'Label': 'KoS'},
|
||||||
"Kobo Elipsa": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 1, 'DefaultUpscale': True, 'ForceColor': False,
|
"Kobo Elipsa": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 1, 'DefaultUpscale': True, 'ForceColor': False,
|
||||||
'Label': 'KoE'},
|
'Label': 'KoE'},
|
||||||
"reMarkable 1/2/Pure": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 3, 'DefaultUpscale': True, 'ForceColor': False,
|
"reMarkable 1/2/Pure": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 4, 'DefaultUpscale': True, 'ForceColor': False,
|
||||||
'Label': 'Rmk1'},
|
'Label': 'Rmk1'},
|
||||||
"reMarkable Paper Pro": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 3, 'DefaultUpscale': True, 'ForceColor': True,
|
"reMarkable Paper Pro": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 4, 'DefaultUpscale': True, 'ForceColor': True,
|
||||||
'Label': 'RmkPP'},
|
'Label': 'RmkPP'},
|
||||||
"reMarkable Paper Pro Move": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 3, 'DefaultUpscale': True, 'ForceColor': True,
|
"reMarkable Paper Pro Move": {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 4, 'DefaultUpscale': True, 'ForceColor': True,
|
||||||
'Label': 'RmkPPMove'},
|
'Label': 'RmkPPMove'},
|
||||||
"Other": {'PVOptions': False, 'ForceExpert': True, 'DefaultFormat': 1, 'DefaultUpscale': False, 'ForceColor': False,
|
"Other": {'PVOptions': False, 'ForceExpert': True, 'DefaultFormat': 2, 'DefaultUpscale': False, 'ForceColor': False,
|
||||||
'Label': 'OTHER'},
|
'Label': 'OTHER'},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for s in ProfileData.FIXED_RES_STRINGS:
|
||||||
|
self.profiles[s] = {'PVOptions': False, 'ForceExpert': False, 'DefaultFormat': 2, 'DefaultUpscale': False, 'ForceColor': False,
|
||||||
|
'Label': s}
|
||||||
|
|
||||||
profilesGUI = [
|
profilesGUI = [
|
||||||
"Kindle Scribe Colorsoft",
|
"Kindle Scribe Colorsoft",
|
||||||
"Kindle Scribe 3",
|
"Kindle Scribe 3",
|
||||||
@@ -1679,6 +1685,7 @@ class KCCGUI(QObject, KCC_ui.Ui_mainWindow):
|
|||||||
"reMarkable 1/2/Pure",
|
"reMarkable 1/2/Pure",
|
||||||
"Separator",
|
"Separator",
|
||||||
"Other",
|
"Other",
|
||||||
|
*ProfileData.FIXED_RES_STRINGS,
|
||||||
"Separator",
|
"Separator",
|
||||||
"Kindle Paperwhite 7/10",
|
"Kindle Paperwhite 7/10",
|
||||||
"Kindle Paperwhite 5/6",
|
"Kindle Paperwhite 5/6",
|
||||||
@@ -1795,7 +1802,7 @@ class KCCGUI(QObject, KCC_ui.Ui_mainWindow):
|
|||||||
|
|
||||||
self.modeChange(1)
|
self.modeChange(1)
|
||||||
for profile in profilesGUI:
|
for profile in profilesGUI:
|
||||||
if profile == "Other":
|
if profile == "Other" or profile in ProfileData.FIXED_RES_STRINGS:
|
||||||
GUI.deviceBox.addItem(self.icons.deviceOther, profile)
|
GUI.deviceBox.addItem(self.icons.deviceOther, profile)
|
||||||
elif profile == "Separator":
|
elif profile == "Separator":
|
||||||
GUI.deviceBox.insertSeparator(GUI.deviceBox.count() + 1)
|
GUI.deviceBox.insertSeparator(GUI.deviceBox.count() + 1)
|
||||||
|
|||||||
@@ -1698,7 +1698,7 @@ def checkOptions(options):
|
|||||||
options.white_borders = True
|
options.white_borders = True
|
||||||
options.bordersColor = 'white'
|
options.bordersColor = 'white'
|
||||||
# Disable all Kindle features for other e-readers
|
# Disable all Kindle features for other e-readers
|
||||||
if options.profile == 'OTHER':
|
if options.profile == 'OTHER' or options.profile in image.ProfileData.FIXED_RES_STRINGS:
|
||||||
options.panelview = False
|
options.panelview = False
|
||||||
options.hq = False
|
options.hq = False
|
||||||
if 'Ko' in options.profile:
|
if 'Ko' in options.profile:
|
||||||
|
|||||||
@@ -141,11 +141,31 @@ class ProfileData:
|
|||||||
'RmkPPMove': ("reMarkable Paper Pro Move", (954, 1696), Palette16, 1.0),
|
'RmkPPMove': ("reMarkable Paper Pro Move", (954, 1696), Palette16, 1.0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FIXED_RESOLUTIONS = [
|
||||||
|
(1072, 1448),
|
||||||
|
(1264, 1680),
|
||||||
|
(1404, 1872),
|
||||||
|
(1536, 2048),
|
||||||
|
(1650, 2200),
|
||||||
|
(1860, 2480),
|
||||||
|
(2400, 3200),
|
||||||
|
]
|
||||||
|
|
||||||
|
FIXED_RESOLUTIONS.reverse()
|
||||||
|
|
||||||
|
FIXED_RES_STRINGS = [f'{w}x{h}' for w, h in FIXED_RESOLUTIONS]
|
||||||
|
|
||||||
|
ProfilesFixed = {}
|
||||||
|
for res, s in zip(FIXED_RESOLUTIONS, FIXED_RES_STRINGS):
|
||||||
|
w, h = res
|
||||||
|
ProfilesFixed[s] = (s, res, Palette16, 1.0)
|
||||||
|
|
||||||
Profiles = {
|
Profiles = {
|
||||||
**ProfilesKindle,
|
**ProfilesKindle,
|
||||||
**ProfilesKobo,
|
**ProfilesKobo,
|
||||||
**ProfilesRemarkable,
|
**ProfilesRemarkable,
|
||||||
'OTHER': ("Other", (0, 0), Palette16, 1.0),
|
'OTHER': ("Other", (0, 0), Palette16, 1.0),
|
||||||
|
**ProfilesFixed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user