markup: pass workdir around, don't recalc all the time
This commit is contained in:
@ -3,9 +3,9 @@ from .pdf import parse_pdf
|
||||
from .utils import overlaps
|
||||
|
||||
|
||||
def find_marked_products(pdf, subdir, catname, debug=0):
|
||||
def find_marked_products(pdf, workdir, debug=0):
|
||||
"""Main entry point. Give a pdf, get matches."""
|
||||
(prods, scribbles) = parse_pdf(pdf, subdir, catname, debug)
|
||||
(prods, scribbles) = parse_pdf(pdf, workdir, debug)
|
||||
|
||||
if not prods or len(prods) < 1:
|
||||
print('no product placement markers found')
|
||||
@ -15,7 +15,7 @@ def find_marked_products(pdf, subdir, catname, debug=0):
|
||||
matches = find_matches(prods, scribbles, 0.10)
|
||||
|
||||
for s in scribbles:
|
||||
write_debug_image(subdir, catname, s['page'], prods, scribbles)
|
||||
write_debug_image(workdir, s['page'], prods, scribbles)
|
||||
|
||||
return matches
|
||||
|
||||
|
||||
Reference in New Issue
Block a user