mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 04:52:40 +00:00
Fix: create the scratch dir before zone OCR renders into it
This commit is contained in:
1 parent
5182b719c5
commit
0348dc532f
2 files changed
+3
No files matched your search
@@ -339,6 +339,7 @@ def plan_zone_extraction(
|
||||
if not pages:
|
||||
return []
|
||||
plans = []
|
||||
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(dir=settings.SCRATCH_DIR) as tmp_dir:
|
||||
tmp_path = Path(tmp_dir)
|
||||
page_images = _render_pages(
|
||||
@@ -849,6 +850,7 @@ def extract_zone_preview(
|
||||
) -> ZoneExtraction:
|
||||
"""Extract a zone without writing its value to the document."""
|
||||
page_idx = _resolve_page_idx(zone.page, page_count)
|
||||
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(dir=settings.SCRATCH_DIR) as tmp_dir:
|
||||
tmp_path = Path(tmp_dir)
|
||||
page_images = _render_pages(
|
||||
|
||||
Reference in new issue
Block a user