mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 01:36:27 +00:00
Add backwards compatibility for Pillow >9.1.0 from 4b127b1
This commit is contained in:
@@ -116,6 +116,9 @@ class ComicPageParser:
|
||||
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
|
||||
|
||||
def getImageHistogram(self, image):
|
||||
histogram = image.histogram()
|
||||
@@ -248,6 +251,9 @@ class ComicPage:
|
||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-B'
|
||||
elif 'S2' in mode:
|
||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-C'
|
||||
# backwards compatibility for Pillow >9.1.0
|
||||
if not hasattr(Image, 'Resampling'):
|
||||
Image.Resampling = Image
|
||||
|
||||
def saveToDir(self):
|
||||
try:
|
||||
@@ -375,6 +381,9 @@ class Cover:
|
||||
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
|
||||
|
||||
def process(self):
|
||||
self.image = self.image.convert('RGB')
|
||||
|
||||
Reference in New Issue
Block a user