mirror of
https://github.com/ciromattia/kcc
synced 2026-05-03 06:12:15 +00:00
Compare commits
2 Commits
dependabot
...
v10.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4aeb798c7 | ||
|
|
997a514e2a |
@@ -1,4 +1,4 @@
|
||||
__version__ = '10.1.0'
|
||||
__version__ = '10.1.1'
|
||||
__license__ = 'ISC'
|
||||
__copyright__ = '2012-2022, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>, darodi'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
@@ -1706,27 +1706,27 @@ def makeBook(source, qtgui=None, job_progress=''):
|
||||
size = get_contain_resolution(imagef, (x, y))
|
||||
normalized_resolutions.append(size)
|
||||
|
||||
counter = Counter(normalized_resolutions)
|
||||
counter = Counter(normalized_resolutions)
|
||||
|
||||
aspect_ratios = []
|
||||
filtered_resolutions = []
|
||||
for w, h in normalized_resolutions:
|
||||
aspect_ratio = h / w
|
||||
# page-like aspect ratios, could be improved
|
||||
if aspect_ratio > 1.3 and aspect_ratio < 1.7:
|
||||
aspect_ratios.append(aspect_ratio)
|
||||
filtered_resolutions.append((w, h))
|
||||
aspect_ratios = []
|
||||
filtered_resolutions = []
|
||||
for w, h in normalized_resolutions:
|
||||
aspect_ratio = h / w
|
||||
# page-like aspect ratios, could be improved
|
||||
if aspect_ratio > 1.3 and aspect_ratio < 1.7:
|
||||
aspect_ratios.append(aspect_ratio)
|
||||
filtered_resolutions.append((w, h))
|
||||
|
||||
most_common_res, most_common_count = counter.most_common(1)[0]
|
||||
options.kfx_resolution = most_common_res
|
||||
if most_common_count / counter.total() > .6:
|
||||
pass
|
||||
#elif max(aspect_ratios) - min(aspect_ratios) < .2:
|
||||
else:
|
||||
# get the widest resolution
|
||||
options.kfx_resolution = max(filtered_resolutions)
|
||||
# else:
|
||||
# raise UserWarning('Aspect ratio of pages too different for KFX conversion')
|
||||
most_common_res, most_common_count = counter.most_common(1)[0]
|
||||
options.kfx_resolution = most_common_res
|
||||
if most_common_count / counter.total() > .6:
|
||||
pass
|
||||
#elif max(aspect_ratios) - min(aspect_ratios) < .2:
|
||||
else:
|
||||
# get the widest resolution
|
||||
options.kfx_resolution = max(filtered_resolutions)
|
||||
# else:
|
||||
# raise UserWarning('Aspect ratio of pages too different for KFX conversion')
|
||||
|
||||
if options.noprocessing:
|
||||
print(f"{job_progress}Do not process image, ignore any profile or processing option")
|
||||
|
||||
@@ -2,7 +2,7 @@ Pillow>=11.3.0
|
||||
psutil>=5.9.5
|
||||
requests>=2.31.0
|
||||
python-slugify>=1.2.1
|
||||
packaging>=26.2
|
||||
packaging>=23.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
distro>=1.8.0
|
||||
|
||||
@@ -4,7 +4,7 @@ psutil>=5.9.5
|
||||
requests>=2.31.0
|
||||
python-slugify>=1.2.1
|
||||
raven>=6.0.0
|
||||
packaging>=26.2
|
||||
packaging>=23.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
distro>=1.8.0
|
||||
|
||||
@@ -4,7 +4,7 @@ psutil>=5.9.5
|
||||
requests>=2.31.0
|
||||
python-slugify>=1.2.1
|
||||
raven>=6.0.0
|
||||
packaging>=26.2
|
||||
packaging>=23.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
distro>=1.8.0
|
||||
|
||||
@@ -4,7 +4,7 @@ psutil>=5.9.5
|
||||
requests>=2.31.0
|
||||
python-slugify>=1.2.1,<9.0.0
|
||||
raven>=6.0.0
|
||||
packaging>=26.2
|
||||
packaging>=23.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
distro>=1.8.0
|
||||
|
||||
Reference in New Issue
Block a user