1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-22 06:01:49 +00:00

Improved processing of credit pages

This commit is contained in:
Paweł Jastrzębski
2016-12-08 10:36:05 +01:00
parent 2e55f22355
commit b8e314f6ca
2 changed files with 6 additions and 6 deletions

View File

@@ -820,10 +820,10 @@ def detectCorruption(tmpPath, orgPath):
else: else:
saferRemove(os.path.join(root, name)) saferRemove(os.path.join(root, name))
if imageSmaller > imageNumber * 0.25 and not options.upscale and not options.stretch: if imageSmaller > imageNumber * 0.25 and not options.upscale and not options.stretch:
print("WARNING: More than 1/4 of images are smaller than target device resolution. " print("WARNING: More than 25% of images are smaller than target device resolution. "
"Consider enabling stretching or upscaling to improve readability.") "Consider enabling stretching or upscaling to improve readability.")
if GUI: if GUI:
GUI.addMessage.emit('More than 1/4 of images are smaller than target device resolution.', 'warning', False) GUI.addMessage.emit('More than 25% of images are smaller than target device resolution.', 'warning', False)
GUI.addMessage.emit('Consider enabling stretching or upscaling to improve readability.', 'warning', False) GUI.addMessage.emit('Consider enabling stretching or upscaling to improve readability.', 'warning', False)
GUI.addMessage.emit('', '', False) GUI.addMessage.emit('', '', False)

View File

@@ -119,15 +119,15 @@ class ComicPageParser:
def splitCheck(self): def splitCheck(self):
width, height = self.image.size width, height = self.image.size
dstwidth, dstheight = self.size dstwidth, dstheight = self.size
# Only split if origin is not oriented the same as target if (width > height) != (dstwidth > dstheight) and width <= dstheight and height <= dstwidth \
if (width > height) != (dstwidth > dstheight) and not self.opt.webtoon: and not self.opt.webtoon:
self.payload.append(['R', self.source, self.image.rotate(90, Image.BICUBIC, True), self.color, self.fill])
elif (width > height) != (dstwidth > dstheight) and not self.opt.webtoon:
if self.opt.splitter != 1: if self.opt.splitter != 1:
if width > height: if width > height:
# Source is landscape, so split by the width
leftbox = (0, 0, int(width / 2), height) leftbox = (0, 0, int(width / 2), height)
rightbox = (int(width / 2), 0, width, height) rightbox = (int(width / 2), 0, width, height)
else: else:
# Source is portrait and target is landscape, so split by the height
leftbox = (0, 0, width, int(height / 2)) leftbox = (0, 0, width, int(height / 2))
rightbox = (0, int(height / 2), width, height) rightbox = (0, int(height / 2), width, height)
if self.opt.righttoleft: if self.opt.righttoleft: