1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-24 13:43:13 +00:00

add pdf width box (#1270)

This commit is contained in:
Alex Xu
2026-03-13 16:28:53 -07:00
committed by GitHub
parent b4b9e41a0c
commit b5de6fd39d
6 changed files with 44 additions and 7 deletions
+3 -1
View File
@@ -507,7 +507,9 @@ class ComicPage:
elif method == Image.Resampling.BICUBIC and not self.opt.upscale:
pass
else: # if image bigger than device resolution or smaller with upscaling
if abs(ratio_image - ratio_device) < AUTO_CROP_THRESHOLD:
if self.opt.profile == 'KDX' and abs(ratio_image - ratio_device) < AUTO_CROP_THRESHOLD * 3:
self.image = ImageOps.fit(self.image, self.size, method=method)
elif abs(ratio_image - ratio_device) < AUTO_CROP_THRESHOLD:
self.image = ImageOps.fit(self.image, self.size, method=method)
elif (self.opt.format in ('CBZ', 'PDF') or self.opt.kfx) and not self.opt.white_borders:
self.image = ImageOps.pad(self.image, self.size, method=method, color=self.fill)