mirror of
https://github.com/ciromattia/kcc
synced 2026-01-06 05:19:39 +00:00
Disabled new resizeImage function for older Kindle.
This commit is contained in:
@@ -254,7 +254,7 @@ def applyImgOptimization(img, isSplit=False, toRight=False):
|
||||
img.cropWhiteSpace(10.0)
|
||||
if options.cutpagenumbers:
|
||||
img.cutPageNumber()
|
||||
img.resizeImage(options.upscale, options.stretch, options.black_borders, isSplit, toRight)
|
||||
img.resizeImage(options.upscale, options.stretch, options.black_borders, isSplit, toRight, options.profile)
|
||||
img.quantizeImage()
|
||||
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class ComicPage:
|
||||
palImg.putpalette(self.palette)
|
||||
self.image = self.image.quantize(palette=palImg)
|
||||
|
||||
def resizeImage(self, upscale=False, stretch=False, black_borders=False, isSplit=False, toRight=False):
|
||||
def resizeImage(self, upscale=False, stretch=False, black_borders=False, isSplit=False, toRight=False, profile="KHD"):
|
||||
method = Image.ANTIALIAS
|
||||
if black_borders:
|
||||
fill = 'black'
|
||||
@@ -137,7 +137,7 @@ class ComicPage:
|
||||
fill = 'white'
|
||||
if self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1]:
|
||||
if not upscale:
|
||||
if isSplit:
|
||||
if isSplit and (profile == 'K4' or profile == 'KHD'):
|
||||
borderw = (self.size[0] - self.image.size[0])
|
||||
borderh = (self.size[1] - self.image.size[1]) / 2
|
||||
self.image = ImageOps.expand(self.image, border=(0, borderh), fill=fill)
|
||||
|
||||
Reference in New Issue
Block a user