Disabled cropping and page number cutting for blank pages (close #43)

This commit is contained in:
Paweł Jastrzębski
2013-05-28 12:07:45 +02:00
parent 28dcab8ee8
commit 0b90af77da
2 changed files with 86 additions and 83 deletions
+1
View File
@@ -178,6 +178,7 @@ The app relies and includes the following scripts/binaries:
* Kindle Fire support (color ePub/Mobi) * Kindle Fire support (color ePub/Mobi)
* Panel View support for horizontal content * Panel View support for horizontal content
* Fixed panel order for horizontal pages when --rotate is enabled * Fixed panel order for horizontal pages when --rotate is enabled
* Disabled cropping and page number cutting for blank pages
## COPYRIGHT ## COPYRIGHT
+3 -1
View File
@@ -20,7 +20,7 @@ __copyright__ = '2012-2013, Ciro Mattia Gonano <ciromattia@gmail.com>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import os import os
from PIL import Image, ImageOps, ImageStat from PIL import Image, ImageOps, ImageStat, ImageChops
class ImageFlags: class ImageFlags:
@@ -237,6 +237,7 @@ class ComicPage:
return None return None
def cutPageNumber(self): def cutPageNumber(self):
if ImageChops.invert(self.image).getbbox() is not None:
widthImg, heightImg = self.image.size widthImg, heightImg = self.image.size
delta = 2 delta = 2
diff = delta diff = delta
@@ -290,6 +291,7 @@ class ComicPage:
return self.image return self.image
def cropWhiteSpace(self, threshold): def cropWhiteSpace(self, threshold):
if ImageChops.invert(self.image).getbbox() is not None:
widthImg, heightImg = self.image.size widthImg, heightImg = self.image.size
delta = 10 delta = 10
diff = delta diff = delta