1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-24 13:43:13 +00:00

Merge branch 'master' into kcc-fakepanelview

Apply PEP-8 codestyle
This commit is contained in:
Ciro Mattia Gonano
2013-03-13 00:21:09 +01:00
parent 67baf90d04
commit 19dc5cc6f2
2 changed files with 20 additions and 20 deletions
+8 -9
View File
@@ -141,7 +141,8 @@ class ComicPage:
palImg.putpalette(self.palette)
self.image = self.image.quantize(palette=palImg)
def resizeImage(self, upscale=False, stretch=False, black_borders=False, fakePanelViewLandscape=False, isSplit=False, toRight=False, landscapeMode=False):
def resizeImage(self, upscale=False, stretch=False, black_borders=False, fakePanelViewLandscape=False,
isSplit=False, toRight=False, landscapeMode=False):
method = Image.ANTIALIAS
if black_borders:
fill = 'black'
@@ -222,12 +223,11 @@ class ComicPage:
else:
return None
def splitPageFakePanelView(self, targetdir, righttoleft=False, fakePanelWiewLandscape=False):
width, height = self.image.size
if fakePanelWiewLandscape:
topbox = (0, 0, width, ((height / 2) + (height/9)))
bottombox = (0, ((height / 2) - (height/9)), width, height)
topbox = (0, 0, width, ((height / 2) + (height / 9)))
bottombox = (0, ((height / 2) - (height / 9)), width, height)
filename = os.path.splitext(os.path.basename(self.origFileName))
file1 = targetdir + '/' + filename[0] + '-1' + filename[1]
file2 = targetdir + '/' + filename[0] + '-2' + filename[1]
@@ -241,10 +241,10 @@ class ComicPage:
raise RuntimeError('Cannot write image in directory %s: %s' % (targetdir, e))
return file1, file2
else:
topleftbox = (0, 0, ((width / 2) + (width/9)), ((height / 2) + (height/9)))
toprightbox = ((width / 2) - (width/9)), 0, width, ((height / 2) + (height/9))
bottomleftbox = (0, ((height / 2) - (height/9)), ((width / 2) + (width/9)), height)
bototmrightbox = (((width / 2) - (width/9)), ((height / 2) - (height/9)), width, height)
topleftbox = (0, 0, ((width / 2) + (width / 9)), ((height / 2) + (height / 9)))
toprightbox = ((width / 2) - (width / 9)), 0, width, ((height / 2) + (height / 9))
bottomleftbox = (0, ((height / 2) - (height / 9)), ((width / 2) + (width / 9)), height)
bototmrightbox = (((width / 2) - (width / 9)), ((height / 2) - (height / 9)), width, height)
filename = os.path.splitext(os.path.basename(self.origFileName))
file0 = targetdir + '/' + filename[0] + '-0' + filename[1]
file1 = targetdir + '/' + filename[0] + '-1' + filename[1]
@@ -274,7 +274,6 @@ class ComicPage:
raise RuntimeError('Cannot write image in directory %s: %s' % (targetdir, e))
return file0, file1, file2, file3, file4
# def frameImage(self):
# foreground = tuple(self.palette[:3])
# background = tuple(self.palette[-3:])