When no margin detected, reserve a bit more space for comments
This commit is contained in:
1 parent
e7094d850e
commit
78a7b7679c
17 files changed
+357
-28
No files matched your search
@@ -144,7 +144,15 @@ def analyse_margins(images: list[Image.Image], render_dpi: int, reference_width:
|
||||
starts[run_start:] = [0] * (len(images) - run_start)
|
||||
break
|
||||
|
||||
return {'version': 5, 'starts_px': starts, 'groups': groups,
|
||||
pages = []
|
||||
for index in range(len(images)):
|
||||
estimate = page_estimate(index)
|
||||
edge = estimate['edge_mm']
|
||||
pages.append({'page': index + 1, **estimate,
|
||||
'status': 'unknown' if edge is None else
|
||||
('low' if edge < MIN_MARGIN_MM else 'normal')})
|
||||
|
||||
return {'version': 6, 'pages': pages, 'starts_px': starts, 'groups': groups,
|
||||
'no_margin_from_page': no_margin_from_page,
|
||||
'discard_left_fraction': DISCARD_LEFT_FRACTION, 'cut_fraction_of_margin': .5,
|
||||
'standard_margin_mm': STANDARD_MARGIN_MM, 'minimum_margin_mm': MIN_MARGIN_MM,
|
||||
|
||||
Reference in new issue
Block a user