Files
craft-libs/crates/dwg
aiongg 53ac626a31 next CI: derive Preview's Default, restore flatten_write's Cyan ink and main's craft-zip README line, gate the embedded-SVG test on tree, fix doc links
- craft-behavior: Preview<V> derives Default with #[default] Unchanged (clippy::derivable_impls on Rust 1.100).
- craft-prepress tests/flatten_write.rs: main's even-odd test needs the Cyan ink const.
- craft-svg: the embedded-SVG scene test needs the data-URL image resolver, which is behind feature tree.
- Docs: no links to private items (markdown, dwg, ui-patterns), no link to a crate that is not a dependency (frame), write() for the function (doc-binary), an autolink for the URL (update), Self::from_bytes (psd). craft-midi's source_timed and craft-pdf's cos::content keep only their inner docs, so their links resolve inside the module.
- README: main's craft-zip entry with its lenient reader sentence, lost in the 17 Nov merge.
2026-11-17 14:28:37 +00:00
..
2026-11-13 22:45:07 +00:00
2026-11-13 22:45:07 +00:00

craft-dwg

A byte-level bridge between DWG and DXF. It does not expose acadrust types: callers pass bytes, choose limits, and receive converted bytes plus notes about data the conversion could not preserve. Application document mapping remains with the caller.

The default limits reject DWG inputs over 512 MiB and stop DXF output over 1 GiB. The bridge also catches panics from the dependency and validates its conversion diagnostics. Because a small hostile file can declare very large internal sections, size checks alone cannot prevent an allocation failure inside the decoder. On native applications, call use_own_worker() during startup and call serve_if_asked() before normal argument handling. Subsequent decode and encode_* calls then run in a child process with a 30-minute timeout; a crash or stack overflow is contained to that child. The worker has no operating-system memory limit yet. Without a configured worker, conversions are refused rather than run in the current process: call allow_in_process() only for input that is known to be trusted (tests, or bytes this process produced itself). Coordinates, once a worker is configured but cannot start, also fail closed.

The bridge is not built for wasm32 or FreeBSD/aarch64. Those targets retain the public API and return a clear unsupported-build error. The acadrust 0.6.6 dependency is used unmodified under MPL-2.0; its license and third-party notices are in licenses/dwg/ at the workspace root.