mirror of
https://github.com/ciromattia/kcc
synced 2026-09-01 08:27:06 +00:00
Disabled unused functions
This commit is contained in:
+56
-56
@@ -286,28 +286,28 @@ class ComicPage:
|
|||||||
return file1, file2
|
return file1, file2
|
||||||
|
|
||||||
|
|
||||||
def frameImage(self):
|
# def frameImage(self):
|
||||||
foreground = tuple(self.palette[:3])
|
# foreground = tuple(self.palette[:3])
|
||||||
background = tuple(self.palette[-3:])
|
# background = tuple(self.palette[-3:])
|
||||||
widthDev, heightDev = self.size
|
# widthDev, heightDev = self.size
|
||||||
widthImg, heightImg = self.image.size
|
# widthImg, heightImg = self.image.size
|
||||||
pastePt = (
|
# pastePt = (
|
||||||
max(0, (widthDev - widthImg) / 2),
|
# max(0, (widthDev - widthImg) / 2),
|
||||||
max(0, (heightDev - heightImg) / 2)
|
# max(0, (heightDev - heightImg) / 2)
|
||||||
)
|
# )
|
||||||
corner1 = (
|
# corner1 = (
|
||||||
pastePt[0] - 1,
|
# pastePt[0] - 1,
|
||||||
pastePt[1] - 1
|
# pastePt[1] - 1
|
||||||
)
|
# )
|
||||||
corner2 = (
|
# corner2 = (
|
||||||
pastePt[0] + widthImg + 1,
|
# pastePt[0] + widthImg + 1,
|
||||||
pastePt[1] + heightImg + 1
|
# pastePt[1] + heightImg + 1
|
||||||
)
|
# )
|
||||||
imageBg = Image.new(self.image.mode, self.size, background)
|
# imageBg = Image.new(self.image.mode, self.size, background)
|
||||||
imageBg.paste(self.image, pastePt)
|
# imageBg.paste(self.image, pastePt)
|
||||||
draw = ImageDraw.Draw(imageBg)
|
# draw = ImageDraw.Draw(imageBg)
|
||||||
draw.rectangle([corner1, corner2], outline=foreground)
|
# draw.rectangle([corner1, corner2], outline=foreground)
|
||||||
self.image = imageBg
|
# self.image = imageBg
|
||||||
|
|
||||||
def cutPageNumber(self):
|
def cutPageNumber(self):
|
||||||
widthImg, heightImg = self.image.size
|
widthImg, heightImg = self.image.size
|
||||||
@@ -401,37 +401,37 @@ class ComicPage:
|
|||||||
# print "New size: %sx%s"%(self.image.size[0],self.image.size[1])
|
# print "New size: %sx%s"%(self.image.size[0],self.image.size[1])
|
||||||
return self.image
|
return self.image
|
||||||
|
|
||||||
def addProgressbar(self, file_number, files_totalnumber, size, howoften):
|
# def addProgressbar(self, file_number, files_totalnumber, size, howoften):
|
||||||
if file_number // howoften != float(file_number) / howoften:
|
# if file_number // howoften != float(file_number) / howoften:
|
||||||
return self.image
|
# return self.image
|
||||||
white = (255, 255, 255)
|
# white = (255, 255, 255)
|
||||||
black = (0, 0, 0)
|
# black = (0, 0, 0)
|
||||||
widthDev, heightDev = size
|
# widthDev, heightDev = size
|
||||||
widthImg, heightImg = self.image.size
|
# widthImg, heightImg = self.image.size
|
||||||
pastePt = (
|
# pastePt = (
|
||||||
max(0, (widthDev - widthImg) / 2),
|
# max(0, (widthDev - widthImg) / 2),
|
||||||
max(0, (heightDev - heightImg) / 2)
|
# max(0, (heightDev - heightImg) / 2)
|
||||||
)
|
# )
|
||||||
imageBg = Image.new('RGB', size, white)
|
# imageBg = Image.new('RGB', size, white)
|
||||||
imageBg.paste(self.image, pastePt)
|
# imageBg.paste(self.image, pastePt)
|
||||||
self.image = imageBg
|
# self.image = imageBg
|
||||||
widthImg, heightImg = self.image.size
|
# widthImg, heightImg = self.image.size
|
||||||
draw = ImageDraw.Draw(self.image)
|
# draw = ImageDraw.Draw(self.image)
|
||||||
#Black rectangle
|
# Black rectangle
|
||||||
draw.rectangle([(0, heightImg - 3), (widthImg, heightImg)], outline=black, fill=black)
|
# draw.rectangle([(0, heightImg - 3), (widthImg, heightImg)], outline=black, fill=black)
|
||||||
#White rectangle
|
# White rectangle
|
||||||
draw.rectangle([(widthImg * file_number / files_totalnumber, heightImg - 3), (widthImg - 1, heightImg)],
|
# draw.rectangle([(widthImg * file_number / files_totalnumber, heightImg - 3), (widthImg - 1, heightImg)],
|
||||||
outline=black, fill=white)
|
# outline=black, fill=white)
|
||||||
#Making notches
|
# Making notches
|
||||||
for i in range(1, 10):
|
# for i in range(1, 10):
|
||||||
if i <= (10 * file_number / files_totalnumber):
|
# if i <= (10 * file_number / files_totalnumber):
|
||||||
notch_colour = white # White
|
# notch_colour = white # White
|
||||||
else:
|
# else:
|
||||||
notch_colour = black # Black
|
# notch_colour = black # Black
|
||||||
draw.line([(widthImg * float(i) / 10, heightImg - 3), (widthImg * float(i) / 10, heightImg)],
|
# draw.line([(widthImg * float(i) / 10, heightImg - 3), (widthImg * float(i) / 10, heightImg)],
|
||||||
fill=notch_colour)
|
# fill=notch_colour)
|
||||||
#The 50%
|
# The 50%
|
||||||
if i == 5:
|
# if i == 5:
|
||||||
draw.rectangle([(widthImg / 2 - 1, heightImg - 5), (widthImg / 2 + 1, heightImg)],
|
# draw.rectangle([(widthImg / 2 - 1, heightImg - 5), (widthImg / 2 + 1, heightImg)],
|
||||||
outline=black, fill=notch_colour)
|
# outline=black, fill=notch_colour)
|
||||||
return self.image
|
# return self.image
|
||||||
|
|||||||
Reference in New Issue
Block a user