mirror of
https://github.com/ciromattia/kcc
synced 2026-10-20 16:32:31 +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.color = self.colorCheck()
|
||||||
self.fill = self.fillCheck()
|
self.fill = self.fillCheck()
|
||||||
self.splitCheck()
|
self.splitCheck()
|
||||||
|
# backwards compatibility for Pillow >9.1.0
|
||||||
|
if not hasattr(Image, 'Resampling'):
|
||||||
|
Image.Resampling = Image
|
||||||
|
|
||||||
def getImageHistogram(self, image):
|
def getImageHistogram(self, image):
|
||||||
histogram = image.histogram()
|
histogram = image.histogram()
|
||||||
@@ -248,6 +251,9 @@ class ComicPage:
|
|||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-B'
|
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-B'
|
||||||
elif 'S2' in mode:
|
elif 'S2' in mode:
|
||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-C'
|
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):
|
def saveToDir(self):
|
||||||
try:
|
try:
|
||||||
@@ -375,6 +381,9 @@ class Cover:
|
|||||||
self.tomeid = tomeid
|
self.tomeid = tomeid
|
||||||
self.image = Image.open(source)
|
self.image = Image.open(source)
|
||||||
self.process()
|
self.process()
|
||||||
|
# backwards compatibility for Pillow >9.1.0
|
||||||
|
if not hasattr(Image, 'Resampling'):
|
||||||
|
Image.Resampling = Image
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
self.image = self.image.convert('RGB')
|
self.image = self.image.convert('RGB')
|
||||||
|
|||||||
Reference in New Issue
Block a user