about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaweł Jastrzębski <[email protected]>2016-12-08 10:36:05 +0100
committerPaweł Jastrzębski <[email protected]>2016-12-08 10:36:05 +0100
commitb8e314f6cafe0c1453d80edd298ad3f297cd7514 (patch)
tree7331e528be398cbe86d939407f64ae945115c309
parentUpdated README + version bump (diff)
downloadkcc-b8e314f6cafe0c1453d80edd298ad3f297cd7514.tar.gz
kcc-b8e314f6cafe0c1453d80edd298ad3f297cd7514.tar.bz2
kcc-b8e314f6cafe0c1453d80edd298ad3f297cd7514.zip
Improved processing of credit pages
-rwxr-xr-xkcc/comic2ebook.py4
-rwxr-xr-xkcc/image.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index e16ea4f..3cdc7c9 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -820,10 +820,10 @@ def detectCorruption(tmpPath, orgPath):
             else:
                 saferRemove(os.path.join(root, name))
     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.")
         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('', '', False)
 
diff --git a/kcc/image.py b/kcc/image.py
index 682ae45..28098e7 100755
--- a/kcc/image.py
+++ b/kcc/image.py
@@ -119,15 +119,15 @@ class ComicPageParser:
     def splitCheck(self):
         width, height = self.image.size
         dstwidth, dstheight = self.size
-        # Only split if origin is not oriented the same as target
-        if (width > height) != (dstwidth > dstheight) and not self.opt.webtoon:
+        if (width > height) != (dstwidth > dstheight) and width <= dstheight and height <= dstwidth \
+                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 width > height:
-                    # Source is landscape, so split by the width
                     leftbox = (0, 0, int(width / 2), height)
                     rightbox = (int(width / 2), 0, width, height)
                 else:
-                    # Source is portrait and target is landscape, so split by the height
                     leftbox = (0, 0, width, int(height / 2))
                     rightbox = (0, int(height / 2), width, height)
                 if self.opt.righttoleft: