1
0
mirror of https://github.com/ciromattia/kcc synced 2026-05-27 17:53:28 +00:00

Draft of FakePanelView mode #2

This commit is contained in:
Paweł Jastrzębski
2013-03-10 17:29:06 +01:00
parent eb7766a5e5
commit 712f728a5e
+19 -4
View File
@@ -272,7 +272,10 @@ def applyImgOptimization(img, isSplit=False, toRight=False):
img.cropWhiteSpace(10.0) img.cropWhiteSpace(10.0)
if options.cutpagenumbers: if options.cutpagenumbers:
img.cutPageNumber() img.cutPageNumber()
img.resizeImage(options.upscale, options.stretch, options.black_borders, isSplit, toRight, options.landscapemode) if options.fakepanelview:
img.resizeImage(True, False, options.black_borders, False, False, False)
else:
img.resizeImage(options.upscale, options.stretch, options.black_borders, isSplit, toRight, options.landscapemode)
if not options.notquantize: if not options.notquantize:
img.quantizeImage() img.quantizeImage()
@@ -315,30 +318,38 @@ def dirImgProcess(path):
facing = "left" facing = "left"
if options.fakepanelview: if options.fakepanelview:
img0 = image.ComicPage(split[0], options.profile) img0 = image.ComicPage(split[0], options.profile)
applyImgOptimization(img0, True)
splitA = img0.splitPageFakePanelView(dirpath, options.righttoleft) splitA = img0.splitPageFakePanelView(dirpath, options.righttoleft)
img00 = image.ComicPage(splitA[0], options.profile) img00 = image.ComicPage(splitA[0], options.profile)
applyImgOptimization(img00)
img00.saveToDir(dirpath, options.notquantize) img00.saveToDir(dirpath, options.notquantize)
img01 = image.ComicPage(splitA[1], options.profile) img01 = image.ComicPage(splitA[1], options.profile)
applyImgOptimization(img01)
img01.saveToDir(dirpath, options.notquantize) img01.saveToDir(dirpath, options.notquantize)
img02 = image.ComicPage(splitA[2], options.profile) img02 = image.ComicPage(splitA[2], options.profile)
applyImgOptimization(img02)
img02.saveToDir(dirpath, options.notquantize) img02.saveToDir(dirpath, options.notquantize)
img03 = image.ComicPage(splitA[3], options.profile) img03 = image.ComicPage(splitA[3], options.profile)
applyImgOptimization(img03)
img03.saveToDir(dirpath, options.notquantize) img03.saveToDir(dirpath, options.notquantize)
img04 = image.ComicPage(splitA[4], options.profile) img04 = image.ComicPage(splitA[4], options.profile)
applyImgOptimization(img04)
img04.saveToDir(dirpath, options.notquantize) img04.saveToDir(dirpath, options.notquantize)
img1 = image.ComicPage(split[1], options.profile) img1 = image.ComicPage(split[1], options.profile)
applyImgOptimization(img1, True)
splitB = img1.splitPageFakePanelView(dirpath, options.righttoleft) splitB = img1.splitPageFakePanelView(dirpath, options.righttoleft)
img10 = image.ComicPage(splitB[0], options.profile) img10 = image.ComicPage(splitB[0], options.profile)
applyImgOptimization(img10)
img10.saveToDir(dirpath, options.notquantize) img10.saveToDir(dirpath, options.notquantize)
img11 = image.ComicPage(splitB[1], options.profile) img11 = image.ComicPage(splitB[1], options.profile)
applyImgOptimization(img11)
img11.saveToDir(dirpath, options.notquantize) img11.saveToDir(dirpath, options.notquantize)
img12 = image.ComicPage(splitB[2], options.profile) img12 = image.ComicPage(splitB[2], options.profile)
applyImgOptimization(img12)
img12.saveToDir(dirpath, options.notquantize) img12.saveToDir(dirpath, options.notquantize)
img13 = image.ComicPage(splitB[3], options.profile) img13 = image.ComicPage(splitB[3], options.profile)
applyImgOptimization(img13)
img13.saveToDir(dirpath, options.notquantize) img13.saveToDir(dirpath, options.notquantize)
img14 = image.ComicPage(splitB[4], options.profile) img14 = image.ComicPage(splitB[4], options.profile)
applyImgOptimization(img14)
img14.saveToDir(dirpath, options.notquantize) img14.saveToDir(dirpath, options.notquantize)
else: else:
img0 = image.ComicPage(split[0], options.profile) img0 = image.ComicPage(split[0], options.profile)
@@ -353,17 +364,21 @@ def dirImgProcess(path):
else: else:
facing = "right" facing = "right"
if options.fakepanelview: if options.fakepanelview:
applyImgOptimization(img)
split = img.splitPageFakePanelView(dirpath, options.righttoleft) split = img.splitPageFakePanelView(dirpath, options.righttoleft)
img0 = image.ComicPage(split[0], options.profile) img0 = image.ComicPage(split[0], options.profile)
applyImgOptimization(img0)
img0.saveToDir(dirpath, options.notquantize) img0.saveToDir(dirpath, options.notquantize)
img1 = image.ComicPage(split[1], options.profile) img1 = image.ComicPage(split[1], options.profile)
applyImgOptimization(img1)
img1.saveToDir(dirpath, options.notquantize) img1.saveToDir(dirpath, options.notquantize)
img2 = image.ComicPage(split[2], options.profile) img2 = image.ComicPage(split[2], options.profile)
applyImgOptimization(img2)
img2.saveToDir(dirpath, options.notquantize) img2.saveToDir(dirpath, options.notquantize)
img3 = image.ComicPage(split[3], options.profile) img3 = image.ComicPage(split[3], options.profile)
applyImgOptimization(img3)
img3.saveToDir(dirpath, options.notquantize) img3.saveToDir(dirpath, options.notquantize)
img4 = image.ComicPage(split[4], options.profile) img4 = image.ComicPage(split[4], options.profile)
applyImgOptimization(img4)
img4.saveToDir(dirpath, options.notquantize) img4.saveToDir(dirpath, options.notquantize)
else: else:
applyImgOptimization(img) applyImgOptimization(img)