zune-jpeg keeps every coefficient of an 8-bit progressive frame (SOF2)
beside its output: 2 bytes per sample, per component at its sampling.
That is 9.85 GB for a 48,000 x 34,200 4:4:4 file, more than the decoded
image. JpegInfo::progressive_coefficients reports them from the frame
header, so a caller can admit the decode against its real peak.
Co-Authored-By: Νύξ (Nyx, AI) 🌑 <nyx@despotak.is>
For storytold/photocraft#12473: PhotoCraft lifts its 2^30 px JPEG cap
only after admitting the decode against free memory, and for that it
needs the frame before decoding. jpeg_info reads it from the markers
alone: the stored size, the layout decode returns, and
whole_coefficients, set when decode hands the file to craft-jpeg
(arithmetic-coded, lossless or 12-bit frames), whose working set is
several times the decoded image. None without a frame of 1, 3 or 4
components.
This was part of storytold/photocraft#12604 until
storytold/photocraft#14236 moved the codecs here.
Co-Authored-By: Νύξ (Nyx, AI) 🌑 <nyx@despotak.is>
Two review findings on #1225:
A partial paper record was accepted as a candidate of last resort on its
known side alone, so a partial Letter and a partial Legal sharing a
width both agreed with a Legal request and the first one in the driver's
order won - the ticket could select Letter while the layout assumed
Legal. Partial candidates now resolve ambiguity the way full ones do:
one whose name matches the requested standard sheet wins; an ambiguity
that leaves more than one (or none) is not resolved and nothing is
selected.
integer() read only a direct Value, so a paper dimension supplied
through a ParameterRef read as missing and the fallback silently
substituted the requested size for a ticket that named a different one.
The resolution logic the driver's ticket reader already had moves into a
shared resolved_value() helper, and integer() uses it: a referenced
dimension now either agrees or refuses.
Moved from the DOCX part of storytold/wordcraft#6244. Runs are marked with what Word counts as complex script (the run, its paragraph style chain, its table style and the run defaults, not a character style). StyleSheet::table_cells_chr works out a table's cell run formatting once; ResolvedChar gains cs_off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- EncodeFormat::max_channels gave 65535 for WAV and AIFF, whose headers
hold 32767 (a WAV fewer at wider samples, which the doc now says).
- Tests pin the AAC and MP3 layouts, each format's channel limit with the
count above it, and every listed sample rate with its neighbours: the
agreement test alone compared the tables with a writer that reads them.
- Docs: FileEncoder::bitrate points at the rule RateControl::Bitrate
states; the README says when check exists.
Refs #1230
- EncodeOptions::check says whether a file can be begun, with the error
FileEncoder::new would return and nothing written.
- EncodeOptions::bitrate and FileEncoder::bitrate give the constant bit
rate actually used, after it is moved to one the stream can carry.
- EncodeFormat::sample_rates, max_channels, fixed_layouts, supports_layout
and supports_quality say what a format takes, also when its feature is
off. The writer reads its layouts from the same table, and tests hold
the tables to the encoders and to what the writer accepts.
Refs #1230
- ffmpeg 8 skips an AAC M4A's priming but plays the last packet's padding
(ffmpeg 9 cuts it): the ffmpeg oracle test takes either length, and the
README says which readers end the audio where.
- With alac-encode and no aac-encode, `m4a` names ALAC: the extension test
compared it with AAC.
Refs #1230
Package::styles() reads styles.bin into the same Styles the XML part
gives: number formats, fonts, fills, borders, cell and cell style
formats, cell styles, differential formats and indexed colours, spelled
as Excel writes them in styles.xml. A damaged part is a warning and no
styles; each table holds at most 65,536 entries.
Closes#1253.
Image equality no longer short-cuts on a shared buffer. An image holding
NaN compared equal to its clone but unequal to the same image built
again; it is now unequal to both, as f32 comparison gives.
The four weighted texels are summed in f64 and a finite sum is clamped
to the f32 range. Rounded weights can add up to slightly more than 1,
which made a constant image of f32::MAX sample to infinity at some
coordinates. Infinite texels still give an infinite or NaN sample.
The crate docs and README now limit the OutOfMemory guarantee of the
try_ forms to the pixel buffer, and name the Arc and the try_resize
resampler as allocations that are not fallible.