mirror of
https://github.com/ciromattia/kcc
synced 2025-12-21 05:31:49 +00:00
Minor tweaks
This commit is contained in:
@@ -292,9 +292,9 @@ class Ui_KCC(object):
|
|||||||
if enable:
|
if enable:
|
||||||
if self.currentMode == 1:
|
if self.currentMode == 1:
|
||||||
self.modeBasic()
|
self.modeBasic()
|
||||||
if self.currentMode == 2:
|
elif self.currentMode == 2:
|
||||||
self.modeAdvanced()
|
self.modeAdvanced()
|
||||||
if self.currentMode == 3:
|
elif self.currentMode == 3:
|
||||||
self.modeExpert()
|
self.modeExpert()
|
||||||
|
|
||||||
def changeGamma(self, value):
|
def changeGamma(self, value):
|
||||||
|
|||||||
@@ -260,7 +260,8 @@ class ComicPage:
|
|||||||
diff -= delta
|
diff -= delta
|
||||||
pageNumberCut2 = diff
|
pageNumberCut2 = diff
|
||||||
diff += delta
|
diff += delta
|
||||||
oldStat = ImageStat.Stat(self.image.crop((0, heightImg - diff, widthImg, heightImg - pageNumberCut2))).var[0]
|
oldStat = ImageStat.Stat(self.image.crop((0, heightImg - diff, widthImg,
|
||||||
|
heightImg - pageNumberCut2))).var[0]
|
||||||
while ImageStat.Stat(self.image.crop((0, heightImg - diff, widthImg, heightImg - pageNumberCut2))).var[0]\
|
while ImageStat.Stat(self.image.crop((0, heightImg - diff, widthImg, heightImg - pageNumberCut2))).var[0]\
|
||||||
< fixedThreshold + oldStat and diff < heightImg / 4:
|
< fixedThreshold + oldStat and diff < heightImg / 4:
|
||||||
diff += delta
|
diff += delta
|
||||||
@@ -268,8 +269,8 @@ class ComicPage:
|
|||||||
pageNumberCut3 = diff
|
pageNumberCut3 = diff
|
||||||
delta = 5
|
delta = 5
|
||||||
diff = delta
|
diff = delta
|
||||||
while ImageStat.Stat(self.image.crop((0, heightImg - pageNumberCut2, diff, heightImg))).var[0] < fixedThreshold\
|
while ImageStat.Stat(self.image.crop((0, heightImg - pageNumberCut2, diff, heightImg))).var[0]\
|
||||||
and diff < widthImg:
|
< fixedThreshold and diff < widthImg:
|
||||||
diff += delta
|
diff += delta
|
||||||
diff -= delta
|
diff -= delta
|
||||||
pageNumberX1 = diff
|
pageNumberX1 = diff
|
||||||
|
|||||||
Reference in New Issue
Block a user