imprimatur 0.6.0-aarch64-linux-gnu → 0.7.0-aarch64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b0c7b03b95799ce827fc16a4c288dc929647e0fc94c6672bac555d75b85140
4
- data.tar.gz: 11b2699bbe2481da51deeeeada85731c85d7577d3cfd06551093866edff29ab1
3
+ metadata.gz: acbd72cb878ab5b6919bbc5ad03997eeeebeffd701dfc14f6d2c5148fc0097a3
4
+ data.tar.gz: 5386038c1564866f29bb1fd0bdeeb0997b53ff71ebc5b49633c2446bc6d10575
5
5
  SHA512:
6
- metadata.gz: e710314613e0b8fde5895a7b751d6458fd52749cd44167828f7a3cee6e9abdebf98befe86c78a832913e3b362e0cbc0b57072ed35742b5bab1dd11e64918623e
7
- data.tar.gz: 1a5eeda8859cafa2ae3ac1b3bac3b50954d4bfbcb7b4562d6c0c04280f5195192eb20fa07aaf167f364e7022e9d5b338ceab269852be9bebd0d40bf9ceaf6d11
6
+ metadata.gz: a2c84c0c17ba5a2f70b78c9d3167c2dab1bf5b73482ea6d148ebd84bc8bb8f6e3e9a598d6e6c64525729ecbd35964104964dbb54e70439c44957893d2ca116a6
7
+ data.tar.gz: bd629f569080f23bba0cee8f15d2f354ae25bec4ae1e1d2967391f123154318cffdd771a9fe49af7c68f8058754639c1d940613c5f1a6307e3463aead34f8c42
data/CHANGELOG.md CHANGED
@@ -2,11 +2,35 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- - Add native PDF metadata, bounded page reads with explicit failure states,
6
- and optional pure-Rust full-page PNG rendering.
7
- - Keep scanned and blank page structure available without a text layer.
8
- - Render PDFs through a bundled Rust worker with time, memory and output limits;
9
- cancellation kills and reaps it. macOS uses an RSS watchdog, not a hard cap.
5
+ - Isolate PDF metadata and text reads in the bundled resource-limited Rust
6
+ worker, as rendering already is; all three accept `memory_bytes:`.
7
+ - On Linux/FreeBSD, re-exec the worker under its address-space limit before
8
+ reading the PDF, including tiny metadata-only reads.
9
+ - Preserve completed pages on worker termination and recover healthy neighbors
10
+ after page-local stream limits without renewing the overall deadline.
11
+ - Allow a bounded exit grace when macOS cannot inspect an exiting worker;
12
+ persistent monitor failures still terminate and reap a live worker.
13
+
14
+ ## [0.7.0](https://github.com/seuros/imprimatur/compare/v0.6.1...v0.7.0) (2026-10-26)
15
+
16
+
17
+ ### Features
18
+
19
+ * **pdf:** add --drop-repeated to remove watermarks anywhere on the page ([8ea82c9](https://github.com/seuros/imprimatur/commit/8ea82c98f6b507ff7ffd296f8e0ec8f30aed529f))
20
+ * **pdf:** emit printed page labels from /PageLabels or footer text ([f761555](https://github.com/seuros/imprimatur/commit/f76155578acfc8514465b93b5b019df100d54de7))
21
+ * **pdf:** recognize numbered sections as headings in markdown output ([341f651](https://github.com/seuros/imprimatur/commit/341f651631b74ff93879f9eba71d0874ae261fd1))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **pdf:** keep ordinal superscripts attached to their base text ([21fbb51](https://github.com/seuros/imprimatur/commit/21fbb510f90ab7c029d22e4e396b887fa66e16c6))
27
+
28
+ ## [0.6.1](https://github.com/seuros/imprimatur/compare/v0.6.0...v0.6.1) (2026-10-25)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **pdf:** isolate bounded reads and preserve page recovery ([fbfbbc5](https://github.com/seuros/imprimatur/commit/fbfbbc5e7e44768efae293b37be255b8b797f831))
10
34
 
11
35
  ## [0.6.0](https://github.com/seuros/imprimatur/compare/v0.5.0...v0.6.0) (2026-10-25)
12
36
 
data/README.md CHANGED
@@ -362,20 +362,31 @@ before allocation (`max_pixels:`, 4 million) and encoded output
362
362
  (`max_output_bytes:`, 8 MiB). Preflight rejects pages drawing more than 40 million
363
363
  source-image pixels. Renderer warnings fail instead of silently dropping content.
364
364
  The crate exposes `read::pdf::{info, pages, render_page}` (`render` feature) and
365
- `read::pdf::isolation::render_page_isolated` (`isolation` feature). The latter
366
- takes an absolute path to the trusted `imprimatur-render-worker` executable.
367
- The gem bundles that worker and always uses isolated rendering; it never falls
368
- back to an in-process render or searches PATH.
365
+ `read::pdf::isolation::{info_isolated, pages_isolated, render_page_isolated}`
366
+ (`isolation` feature). These take an absolute path to the trusted
367
+ `imprimatur-render-worker` executable. The gem bundles that worker and always
368
+ isolates all three PDF operations; it never falls back to in-process parsing
369
+ or searches PATH.
369
370
 
370
- All three accept the normal read limits. Rendering also accepts `memory_bytes:`
371
+ All three accept the normal read limits and `memory_bytes:`
371
372
  (1 GiB by default): Linux/FreeBSD enforce an address-space cap; macOS uses a
372
373
  sampled RSS watchdog, which can briefly overshoot. A worker is killed and reaped
373
- on timeout, cancellation or supervisor failure. Rendering has a mandatory
374
+ on timeout, cancellation or supervisor failure. Each operation has a mandatory
374
375
  60-second process ceiling even with `timeout: nil`; a shorter `timeout:` still
375
376
  applies. CPU time, output files and core dumps are also limited.
376
377
 
378
+ The page worker flushes completed records as it goes. An exhausted stream
379
+ budget triggers individual-page recovery inside that worker: each attempt has
380
+ its own `max_inflated` allowance, while the original overall deadline, process
381
+ memory limit and aggregate text cap remain in force. An oversized page is
382
+ `failed`, not blank, without discarding healthy neighbors. A worker terminated
383
+ after metadata was read preserves completed pages and explicitly marks the
384
+ unreached pages; an expired overall deadline marks them `skipped`. Cancellation
385
+ still raises rather than returning a partial successful call.
386
+
377
387
  This is resource containment, **not a filesystem/network security sandbox**.
378
- The raw crate `render_page` remains in-process and cannot interrupt Hayro.
388
+ The raw crate `info`, `pages` and `render_page` APIs remain in-process;
389
+ `render_page` cannot interrupt Hayro.
379
390
  `max_inflated` bounds our preflight, not Hayro's internal decoders.
380
391
 
381
392
  ```ruby
@@ -3,16 +3,18 @@
3
3
  module Imprimatur
4
4
  # Keyword handling only; parsing, limits and rendering live in the native core.
5
5
  module PdfReader
6
- def self.info(document, max_bytes: nil, **limits)
7
- JSON.parse(Native.pdf_info(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits)),
6
+ def self.info(document, memory_bytes: 1024 * 1024 * 1024, max_bytes: nil, **limits)
7
+ JSON.parse(Native.pdf_info(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits),
8
+ RENDER_WORKER, memory_bytes),
8
9
  symbolize_names: true)
9
10
  end
10
11
 
11
12
  def self.pages(document, first_page: 1, last_page: 0xFFFFFFFF, max_pages: 500,
12
13
  max_page_bytes: 256 * 1024, max_output_bytes: 8 * 1024 * 1024,
13
- max_bytes: nil, **limits)
14
+ memory_bytes: 1024 * 1024 * 1024, max_bytes: nil, **limits)
14
15
  options = [first_page, last_page, max_pages, max_page_bytes, max_output_bytes]
15
- JSON.parse(Native.pdf_pages(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits), options),
16
+ JSON.parse(Native.pdf_pages(Reader.read(document, max_bytes), Reader.limits(max_bytes:, **limits),
17
+ options, RENDER_WORKER, memory_bytes),
16
18
  symbolize_names: true)
17
19
  end
18
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imprimatur
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imprimatur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - Abdelkader Boudih