The pdf module is the whole of M1 except the debug overlay, which needs detection results to draw. Source type is detected per PDF by looking for a page-covering image, and is always reported for confirmation rather than applied silently (ADR 0004). Rasters are extracted via Pixmap(doc, xref) rather than by decoding extract_image() bytes, because MuPDF handles JBIG2 and CCITT scans that no image library will. Scanned pages are extracted at the embedded image's native resolution; only vector pages are rendered, at 600 DPI. Verified against the corpus: Elaman nalka (vector) renders 4959x7017, Ketun joululaulu (scan) loads 1653x2332, Engel (scan) 2552x3504 — and Engel's page 2 is 2480 wide where page 1 is 2552, so scan width varies within one PDF. tests/test_pdf.py builds its own PDFs so the check runs without corpus files, which are copyrighted and gitignored. Closes #1, #2, #3
20 lines
423 B
TOML
20 lines
423 B
TOML
[project]
|
|
name = "noteman-slicer"
|
|
version = "0.1.0"
|
|
description = "Cuts score PDFs into noteman's slice images and markers"
|
|
readme = "README.md"
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"pymupdf>=1.26",
|
|
"numpy>=2.0",
|
|
"opencv-python-headless>=4.10",
|
|
"pyside6>=6.7",
|
|
]
|
|
|
|
[project.scripts]
|
|
noteman-slicer = "noteman_slicer.cli:main"
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|