mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 01:36:27 +00:00
split covers in half if too wide (#874)
This commit is contained in:
@@ -430,6 +430,12 @@ class Cover:
|
|||||||
self.image = ImageOps.autocontrast(self.image)
|
self.image = ImageOps.autocontrast(self.image)
|
||||||
if not self.options.forcecolor:
|
if not self.options.forcecolor:
|
||||||
self.image = self.image.convert('L')
|
self.image = self.image.convert('L')
|
||||||
|
w, h = self.image.size
|
||||||
|
if w / h > 2:
|
||||||
|
if self.options.righttoleft:
|
||||||
|
self.image = self.image.crop((0, 0, w/2 + w * 0.02, h))
|
||||||
|
else:
|
||||||
|
self.image = self.image.crop((w/2 - w * 0.02, 0, w, h))
|
||||||
self.image.thumbnail(self.options.profileData[1], Image.Resampling.LANCZOS)
|
self.image.thumbnail(self.options.profileData[1], Image.Resampling.LANCZOS)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user