Commit Graph
5896 Commits
Author SHA1 Message Date
FredApps ca88e1b78a Merge pull request #1203 from dotCooCoo/fix/ui-tests-share-one-gpu
craft-ui: tests that render take turns with the wgpu renderer
2026-11-15 03:31:42 +01:00
Dylan M. Taylor 6eac1d353d Add neutral XFL shape hint schema views 2026-11-15 02:27:50 +00:00
kiwi4boy 14b2ebb7c2 craft-rtf: one index lookup per insert, and no key String for a known author
`Interned::insert` looked the key up and then inserted it, two probes for a
new key. It now goes through `HashMap::entry`, one probe either way, and
counts that probe itself, so the tests count what the index does.

`author()` built a `String` key on every call. It now looks the author up
borrowed first, and allocates only for a new one.

Review on #1467.
2026-11-14 21:24:56 -05:00
Dylan M. Taylor 6f7106fe0a Expose XFL filter highlight alpha 2026-11-15 02:17:51 +00:00
Dylan M. Taylor e5c3ff46c7 Add neutral XFL filter schema views 2026-11-15 02:14:32 +00:00
kiwi4boy 74495a579a craft-rtf: look up fonts, colours and authors through an index (#1466)
Both writers found each run's font and colour by scanning the table so far
(write.rs `Tables`, doc/export.rs `Tables` and `author` for `\revtbl`), so
a document with n distinct fonts or colours took O(n²) comparisons. 3,000
runs with their own font and colour took 18,006,000 steps in the small
writer and 13,498,500 in the word-model writer.

Each table stays a Vec, in first-use order, so the output is unchanged.
`Interned` adds a map from key to place beside it: the colour, the font
name lowercased (as `eq_ignore_ascii_case` matched), or the trimmed author.

Tests count lookups through a test-only counter, as PdfCraft's own RTF
writer does: at most four per run for 3,000 runs in each writer, and font
names still match without regard to ASCII case.
2026-11-14 21:04:34 -05:00
Dylan M. Taylor 543786812c Merge remote-tracking branch 'origin/main' into fix/avif-exif-hlg 2026-11-15 02:03:26 +00:00
Dylan M. Taylor 497febe524 fix(ber): reject malformed SignedData field structure 2026-11-14 20:57:04 -05:00
Dylan M. Taylor 177f04768a fix(ber): bound metadata allocation for wide hostile inputs 2026-11-14 20:56:34 -05:00
Dylan M. Taylor 603aaacba6 Add neutral XFL text field schema views 2026-11-15 01:54:00 +00:00
Dylan M. Taylor cbd4dcad96 fix(ber): record standalone crate in workspace lockfile 2026-11-14 20:53:46 -05:00
Dylan M. Taylor 18ae39adcb fix(ber): validate CMS containers and integrate workspace crate 2026-11-14 20:50:46 -05:00
Dylan M. Taylor 5c0b0a3632 Deduplicate raster codecs via shared image implementations (successor to #1198) (#1331)
* Share small raster format implementations

(cherry picked from commit 7aedc1de73)

* Preserve raster facade encode contracts

(cherry picked from commit 2db7c82705)

* Allow alpha in IFF compatibility encoder

(cherry picked from commit 80b55dee5a)

* Test shared raster facade contracts and refresh lockfile
2026-11-14 20:46:22 -05:00
Dylan M. Taylor 92c0b49b5e feat(video): support tiled AV1 for large frames (#1453)
* feat(video): add tiled AV1 large-frame fallback

* feat(video): expose tiled AV1 speed preset

* fix(video): use clamped AV1 keyframe interval
2026-11-14 20:38:28 -05:00
vangel76andClaude Sonnet 5.5 6767c71362 Re-run CI: the Ubuntu gate timed out
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 02:26:31 +01:00
Dylan M. Taylor 0f59e325e5 Merge pull request #1456 from storytold/codex/xfl-shape-style-schema
Add neutral XFL shape and media schema views
2026-11-14 20:23:07 -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 c0ce055384 image-codecs: bound PNG row streaming independently of full output 2026-11-14 20:04:36 -05:00
alehel e1e17af671 test(media): VMD frame as high as the picture but not as wide
Review round 3 found no defect; this closes the one placement case the
unit test did not pin.
2026-11-15 01:50:28 +01:00
alehel fcfb66d0c2 fix(media,video,audio): VMD review round 2
- media: correct round 1's frame placement. The picture's position is
  not one value for a file: it starts at the screen's corner and a
  frame with data that is as large as the picture and not at the corner
  moves it for the frames that follow, as ffmpeg was seen to do.
  `picture_rect` now takes the frame's index; `origin()` is gone.
- audio: unknown frame flags are refused for an empty frame too.
- video: count the unpack buffer in the picture budget.
- docs: which sound frames are bounded by what, which cut-short blocks
  are errors, and why sound needs both the flag and a rate.
- tests: ffmpeg's placement cases, the size of the LZ stop, multi-block
  16-bit stereo frames, and an LZ test that compared half its picture.
2026-11-15 01:50:28 +01:00
alehel 75badac3b6 fix(media,video,audio): VMD review round 1
- media: place video frames by the first frame as large as the picture,
  not by the header's position fields, as ffmpeg was seen to do; a
  frame outside the picture has no rectangle.
- media: a file has sound only with the header flag and a sample rate.
- video: stop LZ unpacking at what a picture can use, so a frame's cost
  no longer goes by a length the file states.
- audio: a flags 1 sound frame plays every whole block it holds.
- docs: how sound lines up with pictures, what the buffer count is, and
  which cut-short blocks are errors.
- tests: the frame-count cap, the 0xFF tag near the end of LZ data,
  palette components over 6 bits, the error conversion and the new
  identifiers.
2026-11-15 01:50:28 +01:00
alehel 6ac5f83bb2 feat(media,video,audio): add Sierra VMD demuxer and decoders
Sierra VMD (Video and Music Data) is the video format of Sierra and
Coktel Vision games of the 1990s. Written clean-room from the public
format description at https://wiki.multimedia.cx/index.php/VMD, with
ffmpeg as a black-box oracle.

- craft-media: `vmd` feature, a demuxer for the 816-byte header and the
  table of contents; `Container::Vmd`, `CodecId::VmdVideo` and
  `CodecId::VmdAudio`.
- craft-video: `vmd` feature, a decoder for 8-bit paletted pictures
  (rendering methods 1 to 3, LZ packing, palette changes).
- craft-audio: `vmd-decode` feature, a decoder for 8-bit PCM and 16-bit
  DPCM sound, mono and stereo.
- craft-media-testkit: a VMD fixture writer, since ffmpeg reads VMD but
  cannot write it.

Tests compare the decoders with ffmpeg on generated files, and on real
files when CRAFT_MEDIA_VMD_SAMPLES names a directory of them. 16-bit,
24-bit and Indeo 3 pictures, IMA ADPCM sound and the later header
revisions are not decoded.
2026-11-15 01:50:28 +01:00
Dylan M. Taylor 8e20238384 Merge pull request #1321 from storytold/vorbis-encode-migration
feat(audio): migrate Ogg Vorbis encoding to craft-audio (PR #26)
2026-11-14 19:40:58 -05:00
Dylan M. Taylor e46c81e9cb test(avif): assert HLG color metadata without decoder 2026-11-15 00:40:25 +00:00
Dylan M. Taylor 1a4cf6d0ba Merge pull request #1195 from alehel/craft-video/mpeg2-encode-b
craft-video: MPEG-2 encoder, second step: B pictures (#1133)
2026-11-14 19:39:11 -05:00
Dylan M. Taylor d5a77b7dc1 Preserve legacy XFL matrix coefficient defaults 2026-11-15 00:33:05 +00:00
Dylan M. Taylor e4eddc5fe5 Preserve legacy XFL style table permissiveness 2026-11-15 00:23:42 +00:00
vangel76andClaude Sonnet 5.5 8761999c9b docx charts: automatic marker colour, data label positions, horizontal axis titles
Word draws markers without their own fill in the automatic palette colour of the
series index, not the explicit line colour. Line and scatter data labels sit to
the right of the point unless c:dLblPos says t, b, l, r or ctr. A vertical-axis
title with rot="0" stays horizontal, wrapped into a strip of at most a quarter of
the chart width, instead of being forced to -90 degrees.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:19:18 +01:00
Dylan M. Taylor 352a410332 Expose native XFL drawing primitives 2026-11-15 00:18:46 +00:00
Dylan M. Taylor bb9f9a95cc Add neutral XFL shape and media schema views 2026-11-15 00:12:52 +00:00
Dylan M. Taylor e54d36a76c fix(image-codecs): place AVIF tests after encoders 2026-11-15 00:10:45 +00:00
Dylan M. Taylor 93a7d13aa1 feat: add craft-ber (ASN.1 BER/DER reader)
Port from mailcraft: ASN.1 BER and DER (X.690) reader with:
- TLV parsing (tag, length, value)
- BER to DER conversion (indefinite lengths, constructed OCTET STRINGs)
- CMS signed_data content extraction

No external dependencies. Hostile-input bounded reading.
2026-11-14 19:10:34 -05:00
vangel76andClaude Sonnet 5.5 396402940c docx charts: marker symbols and sizes, data label formats, upward axis titles
A chart file carried three things that were read but not drawn like Word:
- c:marker/c:symbol was ignored (every marker was a circle): squares, diamonds,
  triangles, x, plus, star, dash and dot are drawn now, in the series' c:size;
  unknown names fall back to a circle, sizes are clamped to 2..72 points.
- c:dLbls/c:numFmt (not linked to the source) now formats the data labels, on
  the series or on the chart type; over-long codes are ignored.
- The vertical axis title is turned -90 degrees (reading upwards) as Word does,
  or 90 when the file's bodyPr rot says so. It was always +90.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:06:12 +01:00
vangel76andClaude Sonnet 5.5 537d61a60f rtf: read \ql and \qr after \rtlpar as start and end
The model's paragraph alignment is logical (start/end) in right-to-left
paragraphs, but the reader mapped \ql/\qr straight to left/right. For a
\rtlpar paragraph that mirrored the alignment compared to Word.

Word reads a side word that follows \rtlpar as start/end, and one that comes
before it as plain left/right (checked black-box by saving RTF variants to
DOCX). So \rtlpar\qr is start (no explicit alignment), \rtlpar\ql is end, and
\qr\rtlpar is end. The writer already puts the alignment before \rtlpar, so
its output keeps its meaning and is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:05:40 +01:00
Dylan M. Taylor 35a16a63fd fix(image-codecs): preserve AVIF EXIF and HLG levels 2026-11-14 23:56:16 +00:00
Dylan M. Taylor 92e665a5e8 Exercise Vorbis block boundaries with distinct channel signals 2026-11-14 18:33:24 -05:00
Alex Chambers ed70d09162 craft-heif: a protected Exif or XMP item is unreadable, not absent
A nonzero protection index made `item_info` return before it read the
item type, so a protected `Exif` or XMP item vanished: `scan` was
complete and empty, as if the file held no metadata. The protection
index doesn't hide the type, so read it, and return the item from
`scan` as `Unreadable::Protected`. `read` still leaves it out.
2026-11-15 00:28:28 +01:00
Alex Chambers 7ad164ff8a craft-heif: refuse a too-large item before copying any of it
`Iloc::gather` copied extents until it passed its limit and then
returned `TooLarge`, and `scan` charges its byte budget only for items
it returns. So 1,024 items, each naming one 64 KiB region 257 times,
copied 16 GiB from a 2 MiB file, and `read` up to 1 GiB.

Check every extent and sum the lengths first, and copy only when the
total fits. The new test counts the bytes copied over the full
1,024-gather scan and `read`'s 64 candidates; it copied 16 GiB before.
2026-11-15 00:26:42 +01:00
Dylan M. Taylor 136b29dd76 Merge pull request #1375 from storytold/codex/xfl-xml-shared
Add shared XFL document schema model
2026-11-14 18:16:50 -05:00
Dylan M. Taylor 354acd6a54 Cover Vorbis in format contract tests and assert streaming refusal 2026-11-14 18:15:14 -05:00
Dylan M. Taylor dc2b83d7f4 Document Vorbis rate semantics and validate standalone options 2026-11-14 18:13:31 -05:00
Dylan M. Taylor 9efb0a1575 Complete standalone Vorbis feature and option validation 2026-11-14 18:12:40 -05:00
Dylan M. Taylor 8ae42d1aeb Merge main and reconcile Vorbis encoding with current audio APIs 2026-11-14 18:12:03 -05:00
Dylan M. Taylor ce608a6405 test(raw): omit CFA tag in CR2 fallback regression 2026-11-14 23:10:28 +00:00
alehel c83e8ba250 craft-video: MPEG-2 encoder: flush and timestamp fixes from review (#1133)
- flush ends the GOP for average bitrate too: the budget of the pictures
  the GOP did not get is taken back, so flushed short GOPs no longer
  raise the bitrate.
- A lone picture flushed before a second sets the step gets dts = pts - 1,
  so decoding times still increase if encoding goes on.
- Presentation times whose decoding time does not fit in an i64 are
  refused with BadTimestamp before any state changes.
- Tests: the skip range test uses an f_code that can carry its vector, and
  the reconstruction count is checked before comparing pictures.
2026-11-15 00:07:33 +01:00
Dylan M. Taylor b5778c4f20 test(raw): cover missing-tag CR2 gradient decode 2026-11-14 22:52:35 +00:00
Alex Chambers 2caa7deba1 craft-heif: record the proptest dev-dependency in Cargo.lock 2026-11-14 23:28:51 +01:00
Dylan M. Taylor dd692d907e fix(raw): keep missing-tag CR2 CFA conservative 2026-11-14 22:22:35 +00:00
Dylan M. Taylor 9a33bc229a Cover prefixed XFL settings and frames 2026-11-14 22:20:54 +00:00
Dylan M. Taylor 620775e30b Format shared XFL local-name lookup 2026-11-14 22:16:51 +00:00