1
0
mirror of https://github.com/ciromattia/kcc synced 2026-05-04 06:42:09 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
57509020a9 Update packaging requirement from >=23.2 to >=26.2
Updates the requirements on [packaging](https://github.com/pypa/packaging) to permit the latest version.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/23.2...26.2)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '26.2'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 01:43:28 +00:00
9 changed files with 24 additions and 31 deletions

View File

@@ -199,8 +199,6 @@ sudo apt-get install python3 p7zip-full python3-pil python3-psutil python3-slugi
'KCS': ("Kindle Colorsoft", (1272, 1696), Palette16, 1.0), 'KCS': ("Kindle Colorsoft", (1272, 1696), Palette16, 1.0),
'KS1860': ("Kindle 1860", (1860, 1920), Palette16, 1.0), 'KS1860': ("Kindle 1860", (1860, 1920), Palette16, 1.0),
'KS1920': ("Kindle 1920", (1920, 1920), Palette16, 1.0), 'KS1920': ("Kindle 1920", (1920, 1920), Palette16, 1.0),
'KS1240': ("Kindle 1240", (1240, 1860), Palette16, 1.0),
'KS1324': ("Kindle 1324", (1324, 1986), Palette16, 1.0),
'KS': ("Kindle Scribe 1/2", (1860, 2480), Palette16, 1.0), 'KS': ("Kindle Scribe 1/2", (1860, 2480), Palette16, 1.0),
'KS3': ("Kindle Scribe 3", (1986, 2648), Palette16, 1.0), 'KS3': ("Kindle Scribe 3", (1986, 2648), Palette16, 1.0),
'KSCS': ("Kindle Scribe Colorsoft", (1986, 2648), Palette16, 1.0), 'KSCS': ("Kindle Scribe Colorsoft", (1986, 2648), Palette16, 1.0),

View File

@@ -1261,9 +1261,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
"Kindle 1240x1860": { "Kindle 1240x1860": {
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS1240', 'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS1240',
}, },
"Kindle 1324x1986": {
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS1324',
},
"Kindle Scribe 1/2": { "Kindle Scribe 1/2": {
'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS', 'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': False, 'ForceColor': False, 'Label': 'KS',
}, },
@@ -1371,7 +1368,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
"Separator", "Separator",
"Other", "Other",
"Separator", "Separator",
"Kindle 1324x1986",
"Kindle 1920x1920", "Kindle 1920x1920",
"Kindle 1860x1920", "Kindle 1860x1920",
"Kindle 1240x1860", "Kindle 1240x1860",

View File

@@ -1,4 +1,4 @@
__version__ = '10.1.2' __version__ = '10.1.0'
__license__ = 'ISC' __license__ = 'ISC'
__copyright__ = '2012-2022, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>, darodi' __copyright__ = '2012-2022, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>, darodi'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'

View File

@@ -1706,27 +1706,27 @@ def makeBook(source, qtgui=None, job_progress=''):
size = get_contain_resolution(imagef, (x, y)) size = get_contain_resolution(imagef, (x, y))
normalized_resolutions.append(size) normalized_resolutions.append(size)
counter = Counter(normalized_resolutions) counter = Counter(normalized_resolutions)
aspect_ratios = [] aspect_ratios = []
filtered_resolutions = [] filtered_resolutions = []
for w, h in normalized_resolutions: for w, h in normalized_resolutions:
aspect_ratio = h / w aspect_ratio = h / w
# page-like aspect ratios, could be improved # page-like aspect ratios, could be improved
if aspect_ratio > 1.3 and aspect_ratio < 1.7: if aspect_ratio > 1.3 and aspect_ratio < 1.7:
aspect_ratios.append(aspect_ratio) aspect_ratios.append(aspect_ratio)
filtered_resolutions.append((w, h)) filtered_resolutions.append((w, h))
most_common_res, most_common_count = counter.most_common(1)[0] most_common_res, most_common_count = counter.most_common(1)[0]
options.kfx_resolution = most_common_res options.kfx_resolution = most_common_res
if most_common_count / sum(counter.values()) > .6: if most_common_count / counter.total() > .6:
pass pass
#elif max(aspect_ratios) - min(aspect_ratios) < .2: #elif max(aspect_ratios) - min(aspect_ratios) < .2:
else: else:
# get the widest resolution # get the widest resolution
options.kfx_resolution = max(filtered_resolutions) options.kfx_resolution = max(filtered_resolutions)
# else: # else:
# raise UserWarning('Aspect ratio of pages too different for KFX conversion') # raise UserWarning('Aspect ratio of pages too different for KFX conversion')
if options.noprocessing: if options.noprocessing:
print(f"{job_progress}Do not process image, ignore any profile or processing option") print(f"{job_progress}Do not process image, ignore any profile or processing option")

View File

@@ -106,7 +106,6 @@ class ProfileData:
'KS1860': ("Kindle 1860", (1860, 1920), Palette16, 1.0), 'KS1860': ("Kindle 1860", (1860, 1920), Palette16, 1.0),
'KS1920': ("Kindle 1920", (1920, 1920), Palette16, 1.0), 'KS1920': ("Kindle 1920", (1920, 1920), Palette16, 1.0),
'KS1240': ("Kindle 1240", (1240, 1860), Palette16, 1.0), 'KS1240': ("Kindle 1240", (1240, 1860), Palette16, 1.0),
'KS1324': ("Kindle 1324", (1324, 1986), Palette16, 1.0),
'KS': ("Kindle Scribe 1/2", (1860, 2480), Palette16, 1.0), 'KS': ("Kindle Scribe 1/2", (1860, 2480), Palette16, 1.0),
'KCS': ("Kindle Colorsoft", (1272, 1696), Palette16, 1.0), 'KCS': ("Kindle Colorsoft", (1272, 1696), Palette16, 1.0),
'KS3': ("Kindle Scribe 3", (1986, 2648), Palette16, 1.0), 'KS3': ("Kindle Scribe 3", (1986, 2648), Palette16, 1.0),

View File

@@ -2,7 +2,7 @@ Pillow>=11.3.0
psutil>=5.9.5 psutil>=5.9.5
requests>=2.31.0 requests>=2.31.0
python-slugify>=1.2.1 python-slugify>=1.2.1
packaging>=23.2 packaging>=26.2
mozjpeg-lossless-optimization>=1.2.0 mozjpeg-lossless-optimization>=1.2.0
natsort>=8.4.0 natsort>=8.4.0
distro>=1.8.0 distro>=1.8.0

View File

@@ -4,7 +4,7 @@ psutil>=5.9.5
requests>=2.31.0 requests>=2.31.0
python-slugify>=1.2.1 python-slugify>=1.2.1
raven>=6.0.0 raven>=6.0.0
packaging>=23.2 packaging>=26.2
mozjpeg-lossless-optimization>=1.2.0 mozjpeg-lossless-optimization>=1.2.0
natsort>=8.4.0 natsort>=8.4.0
distro>=1.8.0 distro>=1.8.0

View File

@@ -4,7 +4,7 @@ psutil>=5.9.5
requests>=2.31.0 requests>=2.31.0
python-slugify>=1.2.1 python-slugify>=1.2.1
raven>=6.0.0 raven>=6.0.0
packaging>=23.2 packaging>=26.2
mozjpeg-lossless-optimization>=1.2.0 mozjpeg-lossless-optimization>=1.2.0
natsort>=8.4.0 natsort>=8.4.0
distro>=1.8.0 distro>=1.8.0

View File

@@ -4,7 +4,7 @@ psutil>=5.9.5
requests>=2.31.0 requests>=2.31.0
python-slugify>=1.2.1,<9.0.0 python-slugify>=1.2.1,<9.0.0
raven>=6.0.0 raven>=6.0.0
packaging>=23.2 packaging>=26.2
mozjpeg-lossless-optimization>=1.2.0 mozjpeg-lossless-optimization>=1.2.0
natsort>=8.4.0 natsort>=8.4.0
distro>=1.8.0 distro>=1.8.0