Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 130 additions & 107 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tinydocs"
version.workspace = true
edition = "2024"
rust-version = "1.88"
rust-version = "1.92"
license = "GPL-3.0-only"
description = "Agent-friendly document synthesis and text extraction (DOCX, PPTX, PDF) in Rust."
repository = "https://github.com/tinyhumansai/tinydocs"
Expand Down Expand Up @@ -54,7 +54,7 @@ quick-xml = { version = "0.42", optional = true }
# Workbook row conversion for document-memory Markdown; implementation only.
calamine = { version = "0.38", optional = true }
# Pure Rust PDF rasterization, isolated from the default extraction build.
hayro = { version = "0.5", optional = true }
hayro = { version = "0.6", optional = true }

[dev-dependencies]
# Decode raster fixtures to assert scanned-page pixels survive rendering.
Expand Down
2 changes: 1 addition & 1 deletion crates/tinydocs-module/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tinydocs-module"
version.workspace = true
edition = "2024"
rust-version = "1.88"
rust-version = "1.92"
license = "GPL-3.0-only"
description = "Trusted TinyBus module adapter for TinyDocs."
repository = "https://github.com/tinyhumansai/tinydocs"
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/document-intake-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Run from the TinyDocs repository root:
cargo fmt --all -- --check
cargo test --workspace --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo +1.88.0 check --workspace --all-features
cargo +1.92.0 check --workspace --all-features
cargo deny --all-features check all
```

Expand Down
2 changes: 1 addition & 1 deletion docs/specs/document-intake-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Fixture tests verify ordered Office sections, shared/inline/cached worksheet
values, mixed text/scanned PDFs, raster pixels and PNG dimensions, truncation,
malformed XML, hostile ZIP metadata, and all documented budget rejections.
Bus tests verify schema validation, streamed input, held output reads/releases,
and rollback when a rendering output cannot be retained. MSRV is Rust 1.88.
and rollback when a rendering output cannot be retained. MSRV is Rust 1.92 (hayro 0.6 needs it).

## Open questions

Expand Down
2 changes: 1 addition & 1 deletion scripts/test-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ docker run --rm \
exit 1
}
chmod +x "$installer"
"$installer" -y --profile minimal --default-toolchain 1.88.0 --no-modify-path
"$installer" -y --profile minimal --default-toolchain 1.92.0 --no-modify-path
rm -f "$installer"
source "$HOME/.cargo/env"
actual_target="$(rustc -vV | sed -n "s/^host: //p")"
Expand Down
4 changes: 2 additions & 2 deletions src/pdf_render/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ or renderer resources. A blocking-pool timeout is not cancellation. The host
owns execution deadlines and any stronger process isolation. No network OCR
or remote inference happens here.

Hayro 0.5 and the resolved extraction/render dependency graph compile and test
on the declared Rust 1.88 MSRV.
Hayro 0.6 and the resolved extraction/render dependency graph compile and test
on the declared Rust 1.92 MSRV; hayro 0.6's vello 0.0.7 needs 1.92.
4 changes: 3 additions & 1 deletion src/pdf_render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ pub fn render(bytes: &[u8], spec: &RenderPdfSpec) -> Result<PdfImages> {
pages: Vec::new(),
};
let mut total_bytes = 0u64;
// One cache per document, reused across its pages, as hayro recommends.
let cache = hayro::RenderCache::new();
for (number, width, height, scale) in plans {
let page = &pdf.pages()[(number - 1) as usize];
let settings = hayro::RenderSettings {
Expand All @@ -95,7 +97,7 @@ pub fn render(bytes: &[u8], spec: &RenderPdfSpec) -> Result<PdfImages> {
y_scale: scale,
bg_color: WHITE,
};
let pixmap = hayro::render(page, &InterpreterSettings::default(), &settings);
let pixmap = hayro::render(page, &cache, &InterpreterSettings::default(), &settings);
let bytes = pixmap.into_png().map_err(failed)?;
total_bytes = total_bytes
.checked_add(bytes.len() as u64)
Expand Down
Loading