Commit Graph
49 Commits
Author SHA1 Message Date
Dylan M. Taylor f44195aa11 Reject damaged later SVGZ members 2026-11-15 18:12:18 +00:00
Dylan M. Taylor c4c4547b7b Merge pull request #1602 from storytold/codex/svg-neutral-document
Share streaming SVG primitives and drawing output
2026-11-15 12:10:47 -05:00
Dylan M. Taylor 9eb96c47e0 Merge pull request #1199 from storytold/codex/craft-svg-photo-preflight
Expose shared SVG preflight and viewport rewrite
2026-11-15 11:49:35 -05:00
Dylan M. Taylor 89cbc41650 Satisfy SVG reader clippy gate 2026-11-15 15:22:39 +00:00
Dylan M. Taylor 6c22881fc1 Share streaming neutral SVG geometry and output 2026-11-15 15:16:39 +00:00
Dylan M. Taylor 38c26217b1 Support fixed-precision SVG scene coordinates 2026-11-15 15:01:28 +00:00
FredApps cec6e24381 Check the rewritten SVG viewport output under the same limits 2026-11-15 15:52:47 +01:00
FredApps 4f6e49b1ee Test SVG preflight depth and root viewport rewrite; accept px root sizes
Correct the source-depth expectations (svg>g>path is 3 levels, 2 open), cover
Preflight and every rewrite_root_viewport refusal, and read a root width or
height written with px as the pixels the docs promise.
2026-11-15 15:13:06 +01:00
FredApps 3bfe94538b Merge main into codex/craft-svg-photo-preflight
The base this branch was stacked on has landed separately: #1187 through #1182,
and #1198 through #1331 and #1465. Take main for everything outside crates/svg
so this PR carries only the SVG preflight and viewport rewrite.

In crates/svg, keep main's root_unitless_size, embedded data-URL and text-size
accounting, and check_document, now on top of the shared preflight. Embedded
SVGs still charge the reference-following height to the shared depth budget,
as on main, rather than the source depth.
2026-11-15 15:13:00 +01:00
Dylan M. Taylor d594b6763b fix(svg): use normalized data URL error accounting 2026-11-15 04:32:18 -05:00
Dylan M. Taylor 586041bb68 fix(svg): preserve omission accounting on malformed data 2026-11-15 04:30:16 -05:00
Dylan M. Taylor 4e9b3e9fdd fix(svg): account for invalid embedded image data 2026-11-15 04:11:43 -05:00
Dylan M. Taylor 727f945fc9 Merge branch 'main' into codex/format-adapter-safety 2026-11-14 20:11:50 -05:00
Dylan M. Taylor 465fa74789 fix(metadata,raw,svg): address CodeRabbit review findings 2026-11-14 21:31:04 +00:00
Dylan M. Taylor 30209caad8 feat(gif,image-codecs): add indexed/interlaced GIF, jpeg_progressive_scans, and JP2 decode (#1358)
* feat(gif,image-codecs): add indexed/interlaced GIF, jpeg_progressive_scans, and JP2 decode

* chore: update Cargo.lock for craft-image-codecs jp2 dep

* fix(image-codecs,svg): deref jp2 ch and re-export resvg from craft_svg::tree::draw
2026-11-14 15:13:21 -05:00
Terra854 58ef208c13 fix: preserve RAW identity and SVG byte-limit reporting 2026-11-15 03:49:35 +08:00
Terra854 d61afc4a3b fix: preserve bundle commits and expose SVG resource refusals 2026-11-14 17:53:32 +08:00
Dylan M. Taylor e58cd131af test(svg): use tree-depth limit for referenced depth 2026-11-14 05:17:03 +00:00
Dylan M. Taylor fd708734aa Merge pull request #1182 from storytold/codex/photocraft-file-caps
Add shared format capability catalog
2026-11-13 22:38:59 -05:00
Dylan M. Taylor 344dbef231 Test SVG preflight limits and classify bad embedded SVG 2026-11-13 09:31:49 -05:00
Dylan M. Taylor 3eae15e8ec Expose bounded unitless SVG viewport metadata 2026-11-13 09:31:49 -05:00
Dylan M. Taylor 330280203c Reuse bounded preflight for embedded SVG 2026-11-13 09:31:49 -05:00
Dylan M. Taylor 81bd633c7f Expose checked SVG preflight and viewport rewrite 2026-11-13 09:31:49 -05:00
Dylan M. Taylor c5fae05a5a Merge remote-tracking branch 'upstream/main' into codex/craft-svg-photo-1171-sync
# Conflicts:
#	Cargo.lock
2026-11-13 08:55:10 -05:00
Dylan M. Taylor b5dfdb0bda Fix shared file import edge cases 2026-11-13 07:50:09 -05:00
Dylan M. Taylor f4f48a9ac2 Make open clip fixtures explicitly stroked 2026-11-13 07:36:18 -05:00
Dylan M. Taylor ee548f530c Avoid unused fill contour flag 2026-11-13 07:36:18 -05:00
Dylan M. Taylor 2a8bb6a4e3 Harden neutral vector import and shared output 2026-11-13 07:36:18 -05:00
Dylan M. Taylor 62e2328905 Add shared neutral file import and writer registry 2026-11-13 07:36:18 -05:00
Dylan M. Taylor 59c52ac1dc Merge pull request #1174 from dylanmtaylor/codex/vector-file-imports
Add shared vector path import APIs
2026-11-13 07:35:46 -05:00
Dylan M. Taylor a07481b416 Bound EXR pixel area and SVG image recursion 2026-11-13 06:27:24 -05:00
Dylan M. Taylor 365bf47db6 Expose bounded SVG root dimensions 2026-11-13 06:08:48 -05:00
Dylan M. Taylor dec78a5c40 Split SVG source and expanded-tree depth limits 2026-11-13 06:01:21 -05:00
Dylan M. Taylor 490884beec Add shared SVG subtree render handles 2026-11-13 05:48:22 -05:00
Dylan M. Taylor 4546555126 Fix bounds and limits in shared vector readers 2026-11-13 05:42:34 -05:00
Dylan M. Taylor 435f093b58 Preserve SVG gradients and fallback metadata 2026-11-13 05:41:23 -05:00
Dylan M. Taylor 75d2aeaf17 Expose neutral SVG vector document 2026-11-13 05:41:23 -05:00
Dylan M. Taylor 40304f4295 Report unsupported embedded raster images 2026-11-13 05:24:44 -05:00
Dylan M. Taylor 65a8069d32 Refuse SVG render targets over the memory budget 2026-11-13 04:42:29 -05:00
Dylan M. Taylor 64f0cd410d Share XML depth across embedded SVGs 2026-11-13 04:31:22 -05:00
Dylan M. Taylor 23e633895d Track bounded SVG image resolver usage 2026-11-13 04:31:22 -05:00
Dylan M. Taylor 00d82f5bc7 Add bounded SVG tree rendering facade 2026-11-13 04:31:22 -05:00
Dylan M. Taylor e3d76471f6 Fix vector import edge cases from review 2026-11-13 03:58:22 -05:00
Dylan M. Taylor 85ed941ac5 Address vector import review findings 2026-11-13 03:58:22 -05:00
Dylan M. Taylor 5082d8bd95 Add structured SVG scene writer 2026-11-13 03:58:22 -05:00
Dylan M. Taylor 3afade5163 Expose renderer-neutral SVG preflight 2026-11-13 00:13:31 -05:00
Dylan M. Taylor 9fd3db9484 craft-svg: report the decoded size of nested SVGZ input
* svg: include decoded size in nested stream errors
2026-11-12 06:26:19 -05:00
Dylan M. Taylor 43f65a9210 craft-svg: usvg behind a bounded tree feature; attribute guard; Inkscape layer names (#937)
* craft-svg paths: a shape carries the name of its Inkscape layer

Shape::layer is the inkscape:label (else the id) of the innermost
<g inkscape:groupmode="layer"> around the element, so a CAD or cutter
import can keep the drawing's layers.

* craft-svg guard: bound attributes per element and over the document; find entities holding markup

too_wide is the attribute check of storytold/figcraft#2251: an XML
reader checks each attribute against the earlier ones on its element,
so an element with millions of them is quadratic work before any other
limit applies. entity_holds_markup lets a caller refuse a document type
whose entities become elements, as PhotoCraft does.

* craft-svg: feature `tree`, usvg behind one bounded entry point

usvg 0.48.1 (Apache-2.0 OR MIT), re-exported as craft_svg::tree::usvg,
so every app parses with one version and one set of checks:
tree::parse runs svgz, the entity, attribute and nesting guards, the
reference-chain height (VectorCraft's depth::height, on this crate's
cascade), then usvg. tree::image_resolver bounds embedded SVGs
(FigCraft's budget::resolver). tree::draw bounds what drawing a tree
with resvg allocates (PhotoCraft's svg/limits.rs).

Part of #778 and #789.
2026-11-11 18:46:38 -05:00
Dylan M. Taylor a266035672 craft-svg: craft-svg-paths grows into the SVG crate, with sniffing, SVGZ and pre-parse guards (#881)
crates/svg-paths becomes crates/svg (package craft-svg); the geometry
reader is craft_svg::paths (was the crate root), color and write keep
their names. craft-svg-paths stays as a crate that re-exports them.

New, merged from the copies the apps keep:
- sniff: is_svg, is_svgz
- svgz: bounded gunzip, UTF-8/UTF-16/ISO 8859-1 decoding, compression
- guard: element nesting and entity expansion measured on the text
  (VectorCraft's import/depth.rs text pass and entities.rs)

paths: a smooth segment with no control point to reflect starts at the
current point (S after a quadratic or a close, T after a cubic or a
close), and a relative root width or height (100%, 2em) counts as
absent instead of failing the import.

Part of #778 and #789.
2026-11-11 16:40:42 -05:00