Commit Graph
3507 Commits
Author SHA1 Message Date
vangel76 853f630d6d dds: review fixes for 16-bit support
Reword decode16 and DdsCompression::None docs, check the 16-bit buffer
length before narrowing for BC1-BC3, and test typeless DXGI codes, padded
16-bit rows, G16R16 masks and decode16 of BC1.
2026-11-16 21:59:19 +01:00
vangel76 e4d27fc1cd fcproj-format: schema v18 for camera raw Source Settings
A no-op v17 -> v18 step so FilmCraft can save per-clip camera raw
Source Settings (Interpretation::raw) and older builds refuse such
projects instead of dropping the settings on save. Library part of
storytold/filmcraft#1078 (Part of storytold/filmcraft#1065); the MXF
CinemaDNG part already landed in #1145.
2026-11-16 21:58:20 +01:00
Dylan M. Taylor 5ef5134ccc image-codecs: keep stored WebP dimensions independent of EXIF compatibility (#1921) 2026-11-16 15:55:15 -05:00
vangel76 f200f1c91d dds: 16-bit input and output (R16, R16G16, R16G16B16A16; BC4/BC5 fitted to 16-bit values)
encode16 writes 16-bit pixels uncompressed as R16_UNORM, R16G16_UNORM or
R16G16B16A16_UNORM with the DX10 header, and fits BC4/BC5 endpoints and
indices against the 16-bit values; BC1-BC3 round to 8 bits first.
Texture::decode16 reads these formats (and legacy FourCC 36, wide channel
masks, BC4/BC5 interpolated at 16 bits) without losing precision.
2026-11-16 21:53:12 +01:00
FredApps 617a3cea3b Add craft-media-source: MediaSource, open_bytes, and open_reader (#1891) 2026-11-16 15:51:32 -05:00
Dylan M. Taylor 20220807a4 psd: preserve PhotoCraft lenient TySh prefix parsing (#1923) 2026-11-16 15:51:27 -05:00
Dylan M. Taylor 443a2b05ff docx: preserve partial table margins in current and tracked properties (#1924) 2026-11-16 15:51:23 -05:00
dotCooCoo 227ea620b1 craft-metafile: count refused bitmaps and lost pen textures, empty line clips
- A bitmap that the item or byte limit refuses is counted in
  dropped_images once, however many pieces a clip cuts it into.
- An EMF+ pen whose texture brush was not read is counted in
  dropped_images, as a lost texture brush object is.
- An EMF+ clip path or region path whose figures all lie on a line
  encloses no area, so it gives an empty area instead of its bounding
  rectangle.
2026-11-16 12:05:10 -08:00
dotCooCoo 77505bb715 craft-svg: a bracket in an element declaration does not end the subset
XML readers skip an element, attribute list or notation declaration to its
first `>`, quotes and brackets included. The guard's scans now end these
declarations the same way. A `]` inside `<!ELEMENT svg ] >` no longer ends
the internal subset for `too_wide` and `prescan`, and a `[` in one no longer
lets a later `<!--` hide the entity declarations after it from `declared`.
2026-11-16 12:02:58 -08:00
Dylan M. Taylor 136c34ae4c ffv1: bound thin-frame border and alpha storage before allocation (#1917) 2026-11-16 14:51:27 -05:00
dotCooCoo 52cca84204 fix(csv): count a first record longer than the delimiter sample
sniff_delimiter reads the first 64 KiB of the text and leaves out a
record cut off at that point (#1209). When the first record is longer
than the sample, no record is counted and the function returns comma,
so a semicolon or tab file with a very wide first row opens as one
column.

When no candidate delimiter finds coherent complete records with a
delimiter in each, a candidate that finds no complete record now
counts the delimiters read so far in the first record. Delimiters
inside quoted fields are not counted. A quote inside a field that does
not start with one makes that record incoherent, and the coherent
candidate is picked. When one of those candidates ends the sample
inside a quoted field, each of them counts only up to that field's
opening quote. The per-candidate loop moved into a scan_delimiter
helper, which runs a second scan over the text before that quote.
2026-11-16 11:29:40 -08:00
dotCooCoo 01fcf22cb0 craft-svg: comment markers in a declaration's literal hide no later declaration
declared() skipped a comment or CDATA section wherever `<!--` or
`<![CDATA[` appeared, including inside an entity's quoted value, another
declaration's literal or a processing instruction. With
`<!ENTITY c "<!--">` before a large entity, the scan skipped to the end
of the file, the large entity was never recorded, and
entities_expand_past let its references through to the XML reader.

- declared() reads a declaration's quoted literals and a processing
  instruction as text: a comment or CDATA marker there starts nothing,
  and the declarations after it are still read.
- prescan() counts the markup in an entity's value the same way, and a
  comment, CDATA section or instruction that closes inside the value
  still opens and closes no element.
- too_wide() and prescan() find the end of the internal subset past
  quoted literals, comments and instructions, so a `]>` in a value no
  longer ends the document type early.
2026-11-16 11:23:53 -08:00
Simon Koch-Sultan dca3593452 craft-latex: skip the blanks after a control space
TeX skips the blanks after a control space, `\ ` or `\` and a tab, as it
does after `\` at a line end. The lexer left them to the whitespace branch,
which added a second space, so text taken as written, such as a reference
or an `\item` label, read `one  two`. The control-space branch now skips
them the way the line-end branch does, and a blank line after one still
ends the paragraph.
2026-11-16 14:06:20 -05:00
FredApps 98f50bc151 Preserve retained ODF markup while normalizing stacking orders 2026-11-16 20:01:11 +01:00
dotCooCoo 23317d3284 craft-metafile: report what the reader leaves out
A caller could only tell from skipped_records that part of a file was
not read. Picture now also reports:

- truncated: the parse stopped at a limit that ends it (items, bytes
  kept, SAVEDC depth, clip paths), in the file or in an EMF+ metafile
  image drawn in it.
- dropped_images: images that were not read: bitmaps past a size, byte
  or decode limit or not decodable, EMF+ metafile images that do not
  parse or are nested too deep, and pattern or texture brushes whose
  bitmap was not read. An image with no pixels, or drawn from a source
  rectangle that selects none, is not counted.
- ignored_clips: SELECTCLIPPATH with RGN_OR, RGN_XOR or RGN_DIFF, EMF+
  clips combined with XOR, exclude or complement, EMF+ unions drawn as
  the rectangle around both areas, and EMF+ clip paths and regions
  whose area stands in for the one the file gives, when the clip that
  results can differ from the one the file asks for.
- unplayed_raster_ops: bitmaps drawn as plain copies because their
  raster operation is not SRCCOPY, SRCAND, SRCPAINT or SRCINVERT, and
  operations without a source other than PATCOPY, BLACKNESS and
  WHITENESS.

Behavior changes:

- An EMF+ metafile image adds its own counts, skipped_records included,
  once, the first time it is drawn. A nested picture without a size
  still draws nothing, and its counts are kept.
- A raster operation that takes no source no longer draws the record's
  bitmap. PATCOPY, BLACKNESS and WHITENESS fill the destination in
  STRETCHDIBITS and STRETCHDIB, as they already did in BITBLT,
  STRETCHBLT, DIBBITBLT and DIBSTRETCHBLT. Other such operations
  (DSTINVERT, PATINVERT) are left out and counted.
2026-11-16 11:00:57 -08:00
FredApps 3af718585c Merge pull request #87 from zachshallbetter/feat/cms-constructors
craft-cms: public constructors for matrix/TRC and gray profiles (closes #61)
2026-11-16 19:56:28 +01:00
FredApps 28e1b05e3c Merge pull request #1774 from vangel76/perf/dds-bc45-1766
DDS textures: normal maps and grayscale maps save compressed (BC5/BC4), and DDS saves and opens faster
2026-11-16 19:55:31 +01:00
FredApps 1bc4d093e2 Merge pull request #1890 from storytold/onee/781-compositor-frame
Add craft-color and craft-frame for compositor pictures
2026-11-16 19:54:35 +01:00
FredApps 30cad49e95 Merge pull request #1907 from FredApps/fix/786-psd-consumer-resource-limits
fix(psd): preserve consumer parsing limits and borrow placed pixels
2026-11-16 19:53:51 +01:00
FredApps 0cca4ac66f Merge pull request #1900 from storytold/cutover/packbits-append
stream-codecs: append TIFF PackBits rows without EOD
2026-11-16 19:53:22 +01:00
Dylan M. Taylor 0d6dd8bed8 Merge pull request #1910 from storytold/refactor/timeline-depth-preflight
timeline: share allocation-free XML and JSON nesting preflight
2026-11-16 13:32:41 -05:00
vangel76 b73f8c03ed Merge remote-tracking branch 'upstream/main' into fix/dwg-field-format-2007-tmp 2026-11-16 19:18:25 +01:00
FredApps 3af2280ee3 Merge pull request #1337 from keithcsqueensu/xlsb-tables
craft-xlsx: read the tables of a binary workbook
2026-11-16 19:07:25 +01:00
FredApps c2068fc90b fix(import): normalize maximum drawing stacking orders without replay 2026-11-16 18:54:38 +01:00
FredApps a341e86b6d Merge pull request #1709 from dotCooCoo/feat/craft-texture-axis-sampling
craft-texture: add per-axis wrapping and MaterialCraft's stored sampling
2026-11-16 18:37:03 +01:00
FredApps 37d7236d86 fix(odf): preserve boundary stacking and inline drawing metadata 2026-11-16 18:24:18 +01:00
Simon Koch-Sultan b974484e03 craft-latex: paragraph breaks survive comments, control words and CR line ends (wordcraft#6350, #6365, #6366)
Three ways the lexer lost a blank line, so two paragraphs ran together:

- A comment took its line end with it, so a blank line right after it
  read as a single line end (wordcraft#6350).
- A control word took the spaces and one line end after it, so a blank
  line right after `\relax` at a line end read as a single line end
  (wordcraft#6366).
- Only LF was a line end. TeX ends a line at LF, CR or CRLF. With CR line
  ends every paragraph break was lost, and a comment or a verbatim
  environment ran to the end of the file and dropped the rest of it; with
  CR or CRLF a control word kept the line end after it as a space
  (wordcraft#6365, #6373, #6374, #6375). The lexer now reads every line
  end as LF.

Each symptom has its own test. The CR fix needs the control-word fix
before it: CRLF files read a blank line after a control word correctly
only because the CR stopped the control word from taking the line end.

Port of storytold/wordcraft#6387, whose files moved here with the LaTeX
reader.
2026-11-16 12:18:30 -05:00
Simon Koch-Sultan 9f73a01143 craft-latex: a backslash before a line end or a tab is a control space (wordcraft#6296)
The control symbol branch took the line end or tab after a `\` as the
symbol's name, and the parser drops unknown commands, so `mid\` at a line
end followed by `line` read as `midline`, and a blank line after it no
longer ended the paragraph. TeX reads `\` before a line end or a tab as a
control space, as for `\ `.

- lex.rs: `\` before a line end (LF or CRLF) or a tab gives `Tok::Cmd(" ")`
  and leaves the line end in place, so a following blank line still ends
  the paragraph and the line end adds no second space.
- parser.rs: an optional argument such as an `\item` label reads a
  control space as a space instead of writing `\ ` back as text.

This also keeps apart, on reopening, a paragraph that ends in two spaces:
export writes its last space as a control space at the line end.

Port of storytold/wordcraft#6298, whose files moved here with the LaTeX
reader.
2026-11-16 12:18:30 -05:00
FredApps 520de5f4b2 cms: integrate main and validate constructor wire boundaries 2026-11-16 18:18:22 +01:00
Dylan M. Taylor 3b597748ab timeline: keep provenance in module docs and personal attribution in Git 2026-11-16 12:07:35 -05:00
FredApps 808df4f186 dds: validate public boundaries and bound fallible decoding 2026-11-16 18:01:22 +01:00
Simon Koch-Sultan c3c19cc917 craft-latex: a starred line break shows no star
`\\*` is a line break that also forbids a page break after it. The lexer
read `\\` as the control symbol and left the `*` as text, so `a\\*b`
showed `a`, a line break, then `*b`, `\\*[3pt]` showed `*[3pt]`, and in
a tabular the next row's first cell started with `*`.

The lexer now takes the star with `\\`, so the parser and the tabular
reader see the line break they already handle, with its optional
spacing argument.
2026-11-16 11:54:29 -05:00
FredApps 692a7fe5c9 ci: run the Windows gate's tests with nextest (#1881)
* ci: run the Windows gate's tests with nextest and link with rust-lld

The Windows leg of the Workspace gate takes 55-100 minutes. About half of that is
cargo test running ~370 test binaries one after another, twice (default and all
features), and another 15-17 minutes per feature set is the uncached test build,
where link.exe links every test executable.

- Windows runs the tests with cargo-nextest (parallel across binaries) and the
  doctests with cargo test --doc. The same tests run; .config/nextest.toml puts
  the tests that relied on in-process mutexes (craft-ui GPU, craft-video h264
  fixtures, craft-print) in one-at-a-time groups.
- Windows links with rust-lld via CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER.

Linux and macOS legs are unchanged.

* ci: keep link.exe on the Windows gate

The first run with rust-lld built the tests no faster than link.exe at the same
runner speed (14.4 min against 15.1 min on a runner 8% slower at clippy), so the
linker change is not worth its risk. nextest stays.
2026-11-16 11:45:15 -05:00
FredApps 209a40d66c craft-svg: floor declared() name window to a character boundary (#1899)
* svg: floor declared() name window to a character boundary

If the MAX_NAME+1 cut split a UTF-8 character, get(..bound).unwrap_or(rest)
fell back to scanning the entire suffix. Floor the window instead, and
when recording an overlong name extend to the next character boundary so
the key is still longer than MAX_NAME.

* test(svg): assert declared() keys stay bounded after a multibyte cut

The overlong-name refusal alone also passed on the old unwrap_or(rest)
fallback, which recorded the whole suffix. Bound recorded keys to
MAX_NAME+4 so the test fails if the suffix is stored again.
2026-11-16 11:45:10 -05:00
FredApps 24db17142b Merge pull request #1888 from storytold/onee/781-file-reader
media: add a pooled FileReader ByteSource
2026-11-16 17:43:18 +01:00
FredApps cc63a31309 Validate frame alpha depth and correct color metadata contracts 2026-11-16 17:41:25 +01:00
Dylan M. Taylor ce2ec507c2 Merge pull request #1893 from storytold/feat/psd-unpredict-scratch
psd: support caller-budgeted prediction scratch
2026-11-16 11:38:15 -05:00
Dylan M. Taylor a2560df05b timeline: cover lexical preflight compatibility and deep inputs 2026-11-16 11:25:03 -05:00
Brandon Thomas ecb92f4554 timeline: extract attributed allocation-free XML and JSON preflight scans 2026-11-16 11:24:32 -05:00
FredApps 10a585c3e2 fix(psd): preserve consumer resource limits (#786) 2026-11-16 17:14:31 +01:00
FredApps d839db7d4a Test odd planar layouts and independent storage validation 2026-11-16 17:06:42 +01:00
FredApps b84343883d Validate compositor frame inputs and return allocation errors 2026-11-16 17:04:27 +01:00
FredApps 3824ed5c25 Merge main and handle empty compositor frames safely 2026-11-16 16:57:39 +01:00
FredApps fb2b27b1f0 craft-xlsx: preserve spacing in simple structured references 2026-11-16 16:50:42 +01:00
FredApps a58989cae9 image-codecs: skip a SubIFDs array whose offset is cut off (#1889)
camera_raw_mode read a missing SubIFDs offset as 0, so it walked the TIFF
header as the pointer array and could classify a malformed TIFF as RAW.
Skip the entry instead, matching LightCraft's classifier.
2026-11-16 10:26:36 -05:00
FredApps d60d1b0a45 Merge pull request #1868 from tsw2k/fix/docx-frame-shape
craft-docx: a frame preset shape is a border with a hole
2026-11-16 16:24:26 +01:00
FredApps dd3015c678 wordmodel: keep the kashida length of a justified paragraph (#1875)
* wordmodel: keep the kashida length of a justified paragraph

ST_Jc lowKashida, mediumKashida and highKashida were all read as
Align::Justify, so the length was lost. ParaProps and ResolvedPara now
keep it; a direct both/justify cancels an inherited length. The DOCX
reader and writer round-trip the three values.

* docx: keep a style's kashida length when writing justify

w:jc encodes alignment and kashida together. A paragraph or style
with Align::Justify and kashida unset still inherits a length from
the style chain; writing "both" would read back as Some(Kashida::None)
and cancel it. Use the resolved length in that case.
2026-11-16 10:23:22 -05:00
FredApps 45ad9df637 craft-xlsx: decode XLSB defined names after the workbook's tables are indexed
A defined name's formula may use a structured reference (PtgList). Names were decoded inside
xlsb::workbook, before Package::workbook indexed the table parts, so such a name was left out
and the cells using it kept only their saved results. xlsb::workbook now returns the names
undecoded (Names), and Package::workbook decodes them with xlsb::read_names after
index_tables. Regression: a_name_using_a_structured_reference_is_decoded_after_tables_are_indexed
fails without the reorder.
2026-11-16 16:21:55 +01:00
FredApps fcf14d7d2d Merge main into XLSB tables (defined names, sizes and columns from #1330 and others) 2026-11-16 16:21:55 +01:00
Dylan M. Taylor 963a52ec95 test: report PackBits codec errors without requiring Failure Debug 2026-11-16 10:21:41 -05:00