Commit Graph
7039 Commits
Author SHA1 Message Date
Dylan M. Taylor f135882c7b Merge pull request #1742 from storytold/extract/usd-int-decode
Extract bounded USD Crate integer delta decoding
2026-11-15 18:02:27 -05:00
FredApps c0f7be37f1 Merge pull request #1694 from storytold/codex/ps-actualtext-scope
Keep synthesized PostScript text spans inside clip scopes
2026-11-16 00:02:17 +01:00
aiongg 77e58961b2 Merge commit '9a47a9f65ad07dd3a98c06885db515f167567313' into area/fwb2 2026-11-15 23:02:16 +00:00
Dylan M. Taylor ef87387625 Merge pull request #1720 from storytold/extract/spi1d-parser
cms: extract bounded SPI1D table reader from EffectCraft
2026-11-15 18:01:55 -05:00
FredApps 5f4d546449 Merge pull request #1658 from storytold/codex/fcp7-nesting-bounds
Bound FCP7 nested sequence traversal
2026-11-16 00:01:33 +01:00
FredApps f749643b01 Merge pull request #1603 from storytold/codex/raster-probe-limits
Expose bounded stored raster dimensions
2026-11-16 00:01:21 +01:00
FredApps 984803ad07 Merge pull request #1689 from storytold/codex/zip-owned-archive
Allow ZIP archives to own their input
2026-11-16 00:01:08 +01:00
Dylan M. Taylor 7306195df5 cms: expose bounded ICC embedding normalization with parity tests 2026-11-15 18:00:57 -05:00
vangel76 c27333683a DDS: time decoding a 30 MP texture too
An ignored test beside the encode timings: the best of five decodes of
the same texture written with each compression. It uses only the API
the reader had before, so it runs on the old code for comparison.
2026-11-16 00:00:28 +01:00
vangel76 f31c93cf59 DDS: read and write BC4 and BC5 (grayscale data and normal maps)
BC4 is one block of 16 single-channel values and BC5 two of them, the
block BC3 already stores its alpha in, so the alpha block encoder and
decoder now serve all three (BC3's output stays the same).

Reading: ATI1 and BC4U, and DXGI 79 (typeless) and 80, open as gray;
ATI2 and BC5U, and DXGI 82 (typeless, as Pillow writes it) and 83,
open as RGB with blue 0. ATI2 follows Microsoft's mapping, red in the
first block. Signed BC4S/BC5S and DXGI 81/84 are refused, naming SNORM.

Writing: DdsCompression::Bc4 (bc4, ati1) from gray and Bc5 (bc5, ati2)
from RGB, with the DX10 header (BC4_UNORM, BC5_UNORM, one 2D texture),
mip chains included. The encode plan converts other layouts to gray
and RGB, so the fidelity warnings report colour to gray and dropped
alpha; BC5's dropped blue is documented under LossyCompression.

DdsCompression is now #[non_exhaustive] and ALL has six entries.
2026-11-16 00:00:28 +01:00
vangel76 203f225562 DDS: stop the principal-axis iteration once the axis is a fixed point
A power-iteration step that gives back the same axis bit for bit gives
it back on every later step, so stopping there keeps the output. Kept
only if the timings show a gain.
2026-11-16 00:00:28 +01:00
vangel76 e22ccf3511 DDS: encode and decode faster with the same bytes
Encoding:
- colour blocks keep their colours and endpoint candidates on the stack
  instead of in per-block vectors (the idea of storytold/photocraft#10669)
- a refinement round whose endpoint pair was already fitted ends the
  search, which could not change the block any more
- a block of one colour skips the principal-axis search, whose result
  for it is that colour at both ends
- the alpha block gathers its 16 values once, finds both ranges in one
  pass and picks indices in a plain loop with the same tie-break
- the nearest palette colour is found the same way
- interior blocks are gathered as four rows of four texels, and
  interior mip pixels average their 2x2 source pixels directly

Decoding:
- block-compressed data is decoded one row of blocks per task, copying
  whole texel rows and checking bounds only on the right edge
- uncompressed rows are decoded one per task; when every channel is a
  whole byte (RGBA, BGRA, BGRX, luminance), pixels are a byte shuffle

The f32 arithmetic and its order are unchanged; the digest oracle pins
the output.
2026-11-16 00:00:28 +01:00
vangel76 a98aa0b462 Move the DDS reader and writer into a craft-dds crate without dependencies
craft-dds holds the header parsing, the uncompressed and BC1-BC3
readers and writers and the block encoder, with its own pixel layout
and error types and rayon behind a `parallel` feature. It parses the
header first (Texture::parse) so a caller can check the size against
its limits before anything is allocated.

craft-image-codecs reads and writes DDS through it, re-exports its
DdsCompression and DdsOptions and maps its errors onto CodecError with
the same messages, so its API and output stay the same. Apps that only
need DDS can depend on craft-dds without the other codecs and their
licences.
2026-11-16 00:00:28 +01:00
vangel76 e70cceae33 DDS: pin the writer's and reader's output as SHA-256 digests
Digests of uncompressed, BC1, BC2 and BC3 textures, with and without
mip chains, from deterministic odd-sized pictures (ramps, noise, flat
tiles, alpha at 0, 255 and in between) in RGBA, RGB, gray with alpha
and gray, and of decoding those files and hand-built ones in the other
stored layouts. The table is filled from the unchanged code; on a
mismatch the test prints every digest it computed.
2026-11-16 00:00:28 +01:00
FredApps ac1fc5cea8 Merge remote-tracking branch 'origin/main' into xmlattr 2026-11-16 00:00:18 +01:00
FredApps 17f402798e xml: compare strict expanded attribute names by namespace id, not a URI copy
A declaration's URI was copied once per attribute that used it, so one long URI
and many attributes multiplied memory. Give each binding an id (shared by equal
URIs, found once at declaration) and key expanded names by that id.
2026-11-16 00:00:18 +01:00
wstock 84c84a36fa cms: import deterministic ICC creation-date policy 2026-11-15 17:59:36 -05:00
Brandon Thomas 05d01a5c05 cms: import LightCraft ICC tag alignment 2026-11-15 17:59:36 -05:00
FredApps 3d519f66d2 Merge pull request #1740 from storytold/fix/ps-reencoded-fallback
ps: preserve reencoded glyph names in fallback fonts
2026-11-15 23:59:03 +01:00
FredApps 6909f21a85 Merge pull request #1650 from storytold/codex/shared-control-envelope
Share bounded legacy control envelopes
2026-11-15 23:58:51 +01:00
Dylan M. Taylor bea6ed1ff0 Merge pull request #1633 from storytold/extract/plist-xml
Share bounded XML property-list reader from Craft Anything
2026-11-15 17:58:08 -05:00
FredApps c2443da2ac stream-codecs: decode_ccitt_raw reads rows on bytes as its parameters say
decode_ccitt_raw shared decode_ccitt_within's heuristic of reading Group 3
rows with a leading end-of-line code unaligned even with EncodedByteAlign,
so it read other rows than PostScript's CCITTFaxDecode filter (an aligned
RTC became one more row, and fewer bytes were consumed). The raw API now
reads rows on bytes exactly when encoded_byte_align is set, as hayro-ccitt
does; decode_ccitt_within keeps its heuristic.
2026-11-15 23:57:43 +01:00
FredApps 3a4aecf38c Merge pull request #1698 from storytold/codex/svgz-member-integrity
Reject damaged later SVGZ members
2026-11-15 23:57:14 +01:00
FredApps 643ea04216 Merge pull request #1678 from storytold/codex/webp-canvas-validation
Validate WebP decoder canvas before allocating frames
2026-11-15 23:57:02 +01:00
FredApps cb3551ad3f Merge pull request #1680 from storytold/fix/jls-low-bit-budget
Fix JPEG-LS low-precision scaling and scan allocation limit
2026-11-15 23:56:48 +01:00
FredApps 476f0b08ba Merge remote-tracking branch 'origin/main' into fbx-layer
# Conflicts:
#	crates/mesh/src/tests/fbx.rs
2026-11-15 23:56:06 +01:00
FredApps e42b9e1696 Merge pull request #1731 from storytold/codex/obj-compat-options
Expose compatible OBJ read options
2026-11-15 23:55:19 +01:00
FredApps 3a8c6aef3e Merge pull request #1730 from storytold/codex/obj-stream-bounds
Bound OBJ face and continued-line parsing
2026-11-15 23:54:59 +01:00
FredApps ba0ddffcbb Merge pull request #1716 from storytold/codex/fbx-parent-policy
Allow FBX object-only and last-parent hierarchy policies
2026-11-15 23:54:20 +01:00
FredApps 4b1eb33a5b Merge pull request #1713 from storytold/codex/fbx-strict-geometry
Support strict FBX geometry and final polygons
2026-11-15 23:53:56 +01:00
FredApps b464072bae Merge pull request #1710 from storytold/codex/fbx-rotation-options
Allow FBX pre and post rotations without the active flag
2026-11-15 23:53:27 +01:00
aiongg 9a47a9f65a tfix4-f7: injected input with a NaN or infinite point queues nothing; a release there lets go where the pointer is held 2026-11-15 22:52:38 +00:00
Dylan M. Taylor 7bc122ed0b fix(raw): validate serialized DCP first matrix with reader rules 2026-11-15 17:51:42 -05:00
aiongg c1192adafc tfix4-f7: WindowHost::key_window and typing; the native menu's key equivalents and paste go to the window that has the keys 2026-11-15 22:51:10 +00:00
aiongg 8777f90836 tfix4-f7: trial: a pointer click on the load swatch menu's Clean Brush row reports it once, in one pass or several 2026-11-15 22:51:10 +00:00
Dylan M. Taylor fa7d332cf4 raw: preserve borrowed unique-camera-model identity 2026-11-15 17:50:14 -05:00
Dylan M. Taylor 2651dbeb2b Expose bounded multi-image print PDF serialization with per-image ICC 2026-11-15 17:48:04 -05:00
Dylan M. Taylor 61c1b28c5d test(raw): compare borrowed DNG output with frozen writer and test lossy boundaries 2026-11-15 17:44:43 -05:00
Andrew Frahn 10be8769da raw: share prepared lossy DNG tile serialization
Extract the format portion of LightCraft cc3eb1c8 (lossy DNG export) preserving tile/quality clamps and RGB edge replication. Application rendering/resize/transfer policy stays in the consumer. Callback ownership and fallible allocation integration by Dylan M. Taylor.
2026-11-15 17:44:43 -05:00
Dylan M. Taylor 1864bb7d1d raw: let the DNG writer borrow application image buffers
Reuse existing writer and image layout validation rather than cloning RawImage samples or importing another wire writer. Metadata matrices are value copies; profile/opcode tables and pixel data remain borrowed.
2026-11-15 17:44:43 -05:00
Brandon Thomas f0fa27110d Preserve attributed print raster writer as shared extension source 2026-11-15 17:44:34 -05:00
FredApps 254e9a409b Add craft-deckcraft-format: the .deckcraft package layer from DeckCraft (#1748)
The package layer of DeckCraft's native format, moved from storytold/deckcraft
crates/format at 0d5c0b85 (lib.rs, finite.rs): the mimetype and legacy
SlideCraft type, sniffing, the presentation.json envelope (generic over the
app's presentation), the NaN-safe JSON writer (Finite), the reader that patches
null numbers in older files, member names and compression choice, and the
bounded, budget-charged member reads with the format's limits.

The presentation model, repair, media and chart-part mapping, and outline/RTF
stay in DeckCraft. Writes go through craft-zip's deterministic writer; the
consumer's golden test shows the package bytes are unchanged.

Part of #778.
2026-11-15 23:44:31 +01:00
Dylan M. Taylor 42d8933a29 fix(raw): reject DCP writes without the first color matrix 2026-11-15 17:36:40 -05:00
Dylan M. Taylor 753c676f7b test(cms): cover bounded Cube profile compatibility and token rejection 2026-11-15 17:31:18 -05:00
Brandon Thomas 33852afad4 cms: share bounded three-dimensional Cube profile parsing
Move LightCraft profile-reader semantics (origin 4a490db2) into the existing shared Cube engine. Preserve optional titles, finite endpoints and caller-selected limits; leave application interpolation and registry policies in the consumer. Integration and resource-bound adaptations by Dylan M. Taylor.
2026-11-15 17:31:18 -05:00
NetterSilver 17db8defc2 cms: preserve every numeric token when reading Cube domains
Adapt the strict-token correction from storytold/lightcraft#3464, original commit 77bb537552d59142814eaa65cfea4626c33d6dfc, to the existing shared Cube reader.
2026-11-15 17:31:18 -05:00
Dylan M. Taylor c28f200060 Integrate merged AVIF decoder safeguards into source-depth API 2026-11-15 17:31:11 -05:00
Dylan M. Taylor 7b58f84547 Merge main for shared HTTP URL integration 2026-11-15 17:30:48 -05:00
FredApps 59b4f1e8c2 image-codecs: decode AVIF pixels with the pure-Rust AV1 decoder (#778) (#1601)
* image-codecs: decode AVIF pixels with craft-video's pure-Rust AV1 decoder

New optional `avif-decode` feature (native targets) reads still AVIF
files: the HEIF/ISOBMFF item graph, grids, clap/irot/imir, alpha
auxiliary images (including premultiplied), 8/10/12-bit 4:0:0, 4:2:0,
4:2:2 and 4:4:4, nclx/ICC colour, Exif and XMP, and PQ/HLG to linear
F32 through cicp::linearize as the HEIF path does.

The container walk follows LightCraft #3017 by @emmertex. Every size is
checked against the caller's Limits before the AV1 decoder runs, the
decoder's memory budget is capped by max_alloc, and the decode is
wrapped in catch_unwind so a decoder panic becomes an error.

Fixtures are tiny ffmpeg/libaom files; the 4:2:0 planes match libdav1d
bit for bit. Adds a decode_avif fuzz target.

Part of storytold/craft-libs#778.

* image-codecs, video: address review on the AVIF decoder

- clap: width and height are unsigned fractions, the offsets have signed
  numerators, so 0x80000000/0x40000000 is a width of 2, not -2.
- An item with clap, irot or imir more than once (repeated ipma records)
  is refused before any canvas work, instead of rotating 261120 times.
- Matrix coefficients 10 (BT.2020 constant luminance) is refused rather
  than converted with the non-constant-luminance equations.
- An alpha plane whose own transforms differ from the colour's is refused
  rather than composed in the wrong place; none, or the colour's, still
  decode.
- craft-video: Decoder::set_shown_budget lowers the per-chunk byte cap on
  shown pictures (never above 1 GiB), and the AVIF decoder sets it to
  max_alloc, so a payload of many shown pictures is refused before they
  are built.
2026-11-15 23:25:25 +01:00
Dylan M. Taylor 9b5b517b42 Merge pull request #1759 from storytold/fix/raw-lj92-writer-tile-budget
raw: bound lossless-JPEG DNG writer tile padding
2026-11-15 17:22:33 -05:00