mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-03 15:05:02 -06:00
From CodeRabbit's review of the stack: - Every JBIG2 image read its /JBIG2Globals afresh, within 32 MiB each but with no bound across an export or a redaction. A globals stream of the file, not edited since it was read and with its /DecodeParms direct, now has its filters undone once a document and is kept for the images that share it (in every clone, which share the file), up to 64 MiB in all. An edited one, one added in memory, or one with /DecodeParms by reference (another object, which can change under it) is read each time as before. This saves the filters only: the decoder reads the segments afresh for every image, so a real symbol dictionary still costs its decoding once an image. - view.copy-image dropped "JBIG2 inside other filters" from its missing list on the strength of Export's test; Copy Image now has its own: a JBIG2 picture behind ASCIIHexDecode is found under the pointer and copied as its pixels and as a PNG, and one whose page information is in its globals is read through them. A JBIG2 image's /Width and /Height are read as given directly; one by reference is an error rather than an image of no rows. A /JBIG2Globals reference to no object still reads as no globals: it is a reference to null (ISO 32000-2 §7.3.10), which an entry may hold for being absent (§7.3.7), and the renderer draws the page so. An image that needed those globals then mostly fails to decode; in a probe of twelve pictures that decoded with them, eleven were refused and one decoded to other pixels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
63 lines
2.2 KiB
TOML
63 lines
2.2 KiB
TOML
[package]
|
|
name = "pdfcraft-engine"
|
|
description = "PdfCraft engine façade: session, documents, command/tool catalogue"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
craft-docpath = { workspace = true }
|
|
pdfcraft-measure = { workspace = true }
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "tiff"] }
|
|
pdfcraft-render = { workspace = true }
|
|
pdfcraft-cos = { workspace = true }
|
|
pdfcraft-organize = { workspace = true }
|
|
pdfcraft-annot = { workspace = true }
|
|
pdfcraft-forms = { workspace = true }
|
|
pdfcraft-xfa = { workspace = true }
|
|
pdfcraft-edit = { workspace = true }
|
|
pdfcraft-audit = { workspace = true }
|
|
pdfcraft-redact = { workspace = true }
|
|
pdfcraft-print = { workspace = true }
|
|
pdfcraft-xfdf = { workspace = true }
|
|
pdfcraft-sign = { workspace = true }
|
|
pdfcraft-optimize = { workspace = true }
|
|
pdfcraft-a11y = { workspace = true }
|
|
pdfcraft-ocr = { workspace = true }
|
|
pdfcraft-js = { workspace = true }
|
|
pdfcraft-compare = { workspace = true }
|
|
pdfcraft-preflight = { workspace = true }
|
|
pdfcraft-export = { workspace = true }
|
|
pdfcraft-fonts = { workspace = true }
|
|
pdfcraft-create = { workspace = true }
|
|
pdfcraft-model = { workspace = true }
|
|
pdfcraft-geom = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
png = "0.18"
|
|
# Already in the graph (through image and pdfcraft-create): image's TiffEncoder can't set the
|
|
# resolution or the compression of an exported page.
|
|
tiff = "0.11"
|
|
# Already in the graph (url and idna through webbrowser, icu_properties through boa): they show
|
|
# the host of a document's link the way the browser reads it (links::display_host).
|
|
url = "2.5"
|
|
idna = "1.1"
|
|
icu_properties = "2.3"
|
|
unicode-segmentation = "1.13"
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
# Already in the graph through lopdf; used only for the local UTC offset ("today"). The workspace
|
|
# entry is std-only; this target adds `clock` for `chrono::Local::now`.
|
|
chrono = { workspace = true, features = ["clock"] }
|
|
getrandom = "0.4"
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
|
|
[dev-dependencies]
|
|
pdfcraft-testkit = { workspace = true }
|
|
# JBIG2 fixtures (`encode_jbig2_generic`).
|
|
pdfcraft-filters = { workspace = true }
|