1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-12 17:26:23 +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')

View File

@@ -96,6 +96,7 @@ setuptools.setup(
'psutil>=5.0.0',
'python-slugify>=1.2.1,<8.0.0',
'raven>=6.0.0',
'mozjpeg-lossless-optimization>=1.1.2',
],
classifiers=[],
zip_safe=False,