mirror of
https://github.com/ciromattia/kcc
synced 2026-01-25 22:47:28 +00:00
partial support for Kindle Scribe 2025 models (#1203)
* partial Kindle Scribe 2025 support * make variables better * remove quad
This commit is contained in:
@@ -772,7 +772,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
GUI.rotateBox.setEnabled(True)
|
||||
GUI.borderBox.setEnabled(True)
|
||||
profile = GUI.profiles[str(GUI.deviceBox.currentText())]
|
||||
if profile['Label'] != 'KS':
|
||||
if not profile['Label'].startswith('KS'):
|
||||
GUI.upscaleBox.setEnabled(True)
|
||||
GUI.croppingBox.setEnabled(True)
|
||||
GUI.interPanelCropBox.setEnabled(True)
|
||||
@@ -797,7 +797,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
def toggleImageFormatBox(self, value):
|
||||
profile = GUI.profiles[str(GUI.deviceBox.currentText())]
|
||||
if value == 1:
|
||||
if profile['Label'] == 'KS':
|
||||
if profile['Label'].startswith('KS'):
|
||||
current_format = GUI.formats[str(GUI.formatBox.currentText())]['format']
|
||||
for bad_format in ('MOBI', 'EPUB'):
|
||||
if bad_format in current_format:
|
||||
@@ -859,7 +859,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
if not GUI.webtoonBox.isChecked():
|
||||
GUI.qualityBox.setEnabled(profile['PVOptions'])
|
||||
GUI.upscaleBox.setChecked(profile['DefaultUpscale'])
|
||||
if profile['Label'] == 'KS':
|
||||
if profile['Label'].startswith('KS'):
|
||||
GUI.upscaleBox.setDisabled(True)
|
||||
else:
|
||||
if not GUI.webtoonBox.isChecked():
|
||||
@@ -1180,9 +1180,15 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
'DefaultUpscale': True, 'ForceColor': False, 'Label': 'KPW34'},
|
||||
"Kindle Voyage": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0,
|
||||
'DefaultUpscale': True, 'ForceColor': False, 'Label': 'KV'},
|
||||
"Kindle Scribe": {
|
||||
"Kindle Scribe 1/2": {
|
||||
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS',
|
||||
},
|
||||
"Kindle Scribe 3": {
|
||||
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS3',
|
||||
},
|
||||
"Kindle Scribe Colorsoft": {
|
||||
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': True, 'Label': 'KSCS',
|
||||
},
|
||||
"Kindle 11": {
|
||||
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': True, 'ForceColor': False, 'Label': 'K11',
|
||||
},
|
||||
@@ -1257,9 +1263,11 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
'Label': 'OTHER'},
|
||||
}
|
||||
profilesGUI = [
|
||||
"Kindle Scribe Colorsoft",
|
||||
"Kindle Scribe 3",
|
||||
"Kindle Colorsoft",
|
||||
"Kindle Paperwhite 12",
|
||||
"Kindle Scribe",
|
||||
"Kindle Scribe 1/2",
|
||||
"Kindle Paperwhite 11",
|
||||
"Kindle 11",
|
||||
"Kindle Oasis 9/10",
|
||||
|
||||
@@ -1237,7 +1237,7 @@ def detectSuboptimalProcessing(tmppath, orgpath):
|
||||
GUI.addMessage.emit('Source files are probably created by KCC. The second conversion will decrease quality.'
|
||||
, 'warning', False)
|
||||
GUI.addMessage.emit('', '', False)
|
||||
if imageSmaller > imageNumber * 0.25 and not options.upscale and not options.stretch and options.profile != 'KS':
|
||||
if imageSmaller > imageNumber * 0.25 and not options.upscale and not options.stretch and not options.profile.startswith('KS'):
|
||||
print("WARNING: More than 25% of images are smaller than target device resolution. "
|
||||
"Consider enabling stretching or upscaling to improve readability.")
|
||||
if GUI:
|
||||
@@ -1556,7 +1556,7 @@ def makeBook(source, qtgui=None, job_progress=''):
|
||||
else:
|
||||
checkTools(source)
|
||||
options.kindle_azw3 = options.iskindle and ('MOBI' in options.format or 'EPUB' in options.format)
|
||||
options.kindle_scribe_azw3 = options.profile == 'KS' and ('MOBI' in options.format or 'EPUB' in options.format)
|
||||
options.kindle_scribe_azw3 = options.profile.startswith('KS') and options.kindle_azw3
|
||||
checkPre(source)
|
||||
print(f"{job_progress}Preparing source images...")
|
||||
path = getWorkFolder(source)
|
||||
|
||||
@@ -101,8 +101,10 @@ class ProfileData:
|
||||
'KO': ("Kindle Oasis 2/3/Paperwhite 12", (1264, 1680), Palette16, 1.0),
|
||||
'K11': ("Kindle 11", (1072, 1448), Palette16, 1.0),
|
||||
'KPW5': ("Kindle Paperwhite 5/Signature Edition", (1236, 1648), Palette16, 1.0),
|
||||
'KS': ("Kindle Scribe", (1860, 2480), Palette16, 1.0),
|
||||
'KS': ("Kindle Scribe 1/2", (1860, 2480), Palette16, 1.0),
|
||||
'KCS': ("Kindle Colorsoft", (1264, 1680), Palette16, 1.0),
|
||||
'KS3': ("Kindle Scribe 3", (1920, 2640), Palette16, 1.0),
|
||||
'KSCS': ("Kindle Scribe Colorsoft", (1920, 2640), Palette16, 1.0),
|
||||
}
|
||||
|
||||
ProfilesKindle = {
|
||||
@@ -562,6 +564,7 @@ class Cover:
|
||||
|
||||
size = list(self.options.profileData[1])
|
||||
if self.options.kindle_scribe_azw3:
|
||||
size[0] = min(size[0], 1920)
|
||||
size[1] = min(size[1], 1920)
|
||||
self.image.thumbnail(tuple(size), Image.Resampling.LANCZOS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user