mirror of
https://github.com/ciromattia/kcc
synced 2026-10-17 06:52:32 +00:00
Disabled cropping and page number cutting for blank pages (close #43)
This commit is contained in:
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user