mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 09:46:25 +00:00
10% page number crop
This commit is contained in:
@@ -423,6 +423,10 @@ class ComicPage:
|
|||||||
bbox = get_bbox_crop_margin_page_number(self.image, power, self.fill)
|
bbox = get_bbox_crop_margin_page_number(self.image, power, self.fill)
|
||||||
|
|
||||||
if bbox:
|
if bbox:
|
||||||
|
w, h = self.image.size
|
||||||
|
left, upper, right, lower = bbox
|
||||||
|
# don't crop more than 10% of image
|
||||||
|
bbox = (min(0.1*w, left), min(0.1*h, upper), max(0.9*w, right), max(0.9*h, lower))
|
||||||
self.maybeCrop(bbox, minimum)
|
self.maybeCrop(bbox, minimum)
|
||||||
|
|
||||||
def cropMargin(self, power, minimum):
|
def cropMargin(self, power, minimum):
|
||||||
|
|||||||
Reference in New Issue
Block a user