mirror of
https://github.com/ciromattia/kcc
synced 2026-05-17 21:11:47 +00:00
Image resize fix
This commit is contained in:
@@ -243,6 +243,9 @@ class ComicPage:
|
|||||||
if qualityMode == 2 and self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1]:
|
if qualityMode == 2 and self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1]:
|
||||||
self.purge = True
|
self.purge = True
|
||||||
self.image = ImageOps.expand(self.image, border=(borderw, borderh), fill=fill)
|
self.image = ImageOps.expand(self.image, border=(borderw, borderh), fill=fill)
|
||||||
|
# Border can't be float so sometimes image might be 1px too small/large
|
||||||
|
if self.image.size[0] != size[0] or self.image.size[1] != size[1]:
|
||||||
|
self.image = ImageOps.fit(self.image, size, method=Image.BICUBIC, centering=(0.5, 0.5))
|
||||||
return self.image
|
return self.image
|
||||||
# If stretching is on - Resize without other considerations
|
# If stretching is on - Resize without other considerations
|
||||||
if stretch:
|
if stretch:
|
||||||
|
|||||||
Reference in New Issue
Block a user