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.
* audio: pure-Rust Vorbis encoder, and an Ogg page writer in craft-media
Replace the libvorbis wrapper (vorbis_rs, C, desktop only) behind
`vorbis-encode` with FilmCraft's clean-room Vorbis I encoder by
@JordyUSA (storytold/filmcraft#4481), and move its Ogg page writer into
craft-media's `ogg` module.
craft-audio:
- `vorbis::encoder::{Encoder, EncoderConfig, Error}`: 1-8 channels in
Vorbis order, any sample rate, quality -1 to 10 (VBR), streaming
packets with granule positions.
- `encode_ogg_vorbis` with `OggVorbisOptions` (quality, vendor, tags,
serial) writes a whole Ogg Vorbis file with a comment header.
- `encode_ogg(buf, kbps)` and `OGG_BITRATES` keep working: the bit rate
picks the quality whose nominal rate it is (`quality_for_bitrate`).
- `encode` with `EncodeFormat::Ogg` takes 1-8 channel WAV-order layouts
and writes them in Vorbis order, and `RateControl::Quality`.
- Ogg is built on wasm32 too.
- Residue partitions hold whole sample frames (48, 40, 48 or 56 values
for 3, 5, 6 and 7 channels): libvorbis decodes each partition from
channel 0, so 32-value partitions came out scrambled for those counts.
- The first audio packet gets a page of its own, so a short file's
first audio page is never also its last (ffmpeg then kept the padding).
craft-media: `ogg::PageWriter`, `opus_tags`, `vorbis_comment`.
Part of storytold/craft-libs#778.
* audio, media: address review on the Vorbis encoder and Ogg writer
- Encoder: read cursor into the pending input, compacted once per call,
so a large encode() call no longer moves the tail on every block.
- Tests: check ffmpeg's libvorbis decoder only when ffmpeg has it.
- PageWriter::finish: the end granule replaces the last page's only when
a packet completes on it (RFC 7845 4.4); documented and tested.
- README: Ogg Opus packet granules are the samples decoded so far.
* audio: pick Ogg by extension on wasm32 too
The Vorbis encoder is pure Rust now, so encode_format_for("ogg") follows
the vorbis-encode feature alone, as EncodeFormat::Ogg.is_built() and
ENCODE_EXTENSIONS already do.
Source: storytold/texturecraft bdbb52c9b66b221a55b370105b42f485a76e6fc7. Preserve chunk framing and output cap policy, with fallible allocation and checked offsets.
Reads the [Events] section of ASS v4+ and SSA v4 files and writes a
minimal ASS v4+ file. Keeps line breaks, the Name field as the speaker
and the \i, \b, \u override tags; other override tags and vector
drawings are dropped.
Closes#1550
Adds Format::JpegLs: lossless and near-lossless gray and RGB, 2 to 16
bits. Reads scans that code one component each; writes lossless 8- and
16-bit gray and RGB. Line- and sample-interleaved scans, mapping tables
and colour transforms are reported as unsupported.
Closes#1558
Port PhotoCraft preset_store.rs at 19aec5eb44131de44361189d64910e7b3e19e57c. Preserve original primary author and later codec contributions.
Co-authored-by: David Mann <daaavid.mann@gmail.com>
Co-authored-by: FinnNk <finnnk@gmail.com>
The deep EXR corpus test read the five OpenEXR files in corpus/exr/
without a size bound or digest check, and a missing file failed with
advice to run `cargo xtask corpus --exr`, which craft-libs does not have.
- REAL_FILE_SHA256 pins the five files (OpenEXR commit 69b2604f). The
test reads only those names, refuses a file that is missing, is not
a regular file, is larger than 4 MiB or does not match its digest,
and names the file and both digests.
- The failure points at the crate README, which says where the files
come from and how to fill corpus/exr/, either from OpenEXR or with
PhotoCraft's fetcher at the commit CI uses.
- Three tests that run without the corpus feature cover the pins, a
changed byte, and missing, oversize and folder inputs.