Add exact cover fit option for device-sized cover cropping (#1254)

* Add exact cover fit option for device-sized cover cropping

* Update README to move cover cropping from FAQ to USAGE

* rename to coverfill

* edit readme
This commit is contained in:
tom
2026-02-22 11:34:10 -08:00
committed by GitHub
parent 2632d18e2c
commit 723fa4c0b8
6 changed files with 34 additions and 2 deletions
+4 -1
View File
@@ -569,7 +569,10 @@ class Cover:
if self.options.kindle_scribe_azw3:
size[0] = min(size[0], 1920)
size[1] = min(size[1], 1920)
self.image.thumbnail(tuple(size), Image.Resampling.LANCZOS)
if self.options.coverfill:
self.image = ImageOps.fit(self.image, tuple(size), Image.Resampling.LANCZOS, centering=(0.5, 0.5))
else:
self.image.thumbnail(tuple(size), Image.Resampling.LANCZOS)
def crop_main_cover(self):
w, h = self.image.size