1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

Fix pillow backwards compatibility, add mozjpeg-lossless-optimization to setup.py (#461)

- Fix pillow backwards compatibility
- Add mozjpeg-lossless-optimization to setup.py
This commit is contained in:
Cory Kleinschmidt
2023-01-20 18:35:59 -05:00
committed by GitHub
parent 03bd67cf2f
commit c979486e28
2 changed files with 3 additions and 2 deletions

View File

@@ -115,10 +115,10 @@ class ComicPageParser:
self.image = Image.open(os.path.join(source[0], source[1])).convert('RGB')
self.color = self.colorCheck()
self.fill = self.fillCheck()
self.splitCheck()
# backwards compatibility for Pillow >9.1.0
if not hasattr(Image, 'Resampling'):
Image.Resampling = Image
self.splitCheck()
def getImageHistogram(self, image):
histogram = image.histogram()
@@ -381,10 +381,10 @@ class Cover:
else:
self.tomeid = tomeid
self.image = Image.open(source)
self.process()
# backwards compatibility for Pillow >9.1.0
if not hasattr(Image, 'Resampling'):
Image.Resampling = Image
self.process()
def process(self):
self.image = self.image.convert('RGB')