we_decode_what_ffmpeg_encodes_to_what_ffmpeg_decodes built its input
with ffmpeg's gradients source, which picks random colors on every run,
so the agreement it measured changed from run to run. On one CI run the
4:2:0 case scored 30.5 dB against the 38 dB floor. The test now writes
the file's own picture(67, 41, 3) as raw RGB and feeds it to ffmpeg
through rawvideo, for both the plain and the default-tables encodes.
* feat: add craft-mcp-server (JSON-RPC 2.0 MCP protocol)
Port from solidcraft: MCP server machinery any app may share,
independent of transport and tools.
- JSON-RPC 2.0 over stdio (newline-delimited)
- MCP lifecycle: initialize, initialized, ping, notifications
- Tools: register, list, call with schema validation
- Resources: register, list, get by URI or template
- Prompts: register, list, get with argument completion
- Content blocks: text, image (base64), progress tokens
No external dependencies beyond serde_json.
Follows craft-libs safety pattern: #![deny(clippy::unwrap_used, ...)]
* retrigger CI
* retrigger CI
* Record MCP server dependencies in workspace lockfile
* chore: update rustls-webpki 0.103.15→0.103.16 and zip 9.1.0→9.1.3
A BMP stores its resolution in biXPelsPerMeter and biYPelsPerMeter
(BITMAPINFOHEADER and later). The image crate writes 0 there and nothing
read the fields, so a 300 ppi image saved as BMP reopened at 72 ppi and an
opened BMP's resolution was lost (storytold/photocraft#13630).
decode now reads the fields into Metadata::dpi, encode writes
Metadata::dpi into them whatever embed_metadata says, and
caps(Format::Bmp).dpi is true. encode_bmp_indexed_with_dpi is the palette
writer with a resolution; encode_bmp_indexed keeps its signature and output.
- unpack: checked sample, row-bit and output products, capped at MAX_SAMPLES before allocating
- every chunk is charged what its decoder may allocate (lossless: coded rows + 1/8; lossy: the
32-pixel MCU-padded tile) against the aggregate budget before decoding, the lossless decoder
is held to that, and truncated capacity is released
- the lossy encoded-size floor allows 64 x spp samples per two-bit block (chroma subsampling)
A part shorter than its compression's scan-line group (a one-row ZIP16 part) only decodes its
own rows, so the all-channel block bound is min(scan_lines_per_block, layer_h) rows.
Removes the duplicated Timecode type and BCD decoder (Sonar duplication 28%) and the copied
frame-rate plausibility check; capture_info is tested against the full reader's CinemaTags.
One opcode-list envelope implementation: opcode_raw::Records walks the records (stopping at a
truncated one) for both the strict opcode_raw::parse and the typed opcodes::parse_list, and
opcodes::write_list encodes through opcode_raw::encode instead of truncating lengths with as.
An Exif signature inside a COM segment was taken for the EXIF APP1, and the copy was checked
only against the end of the file, so a replacement longer than the APP1 overwrote the next
marker. Walk the header segments to the first EXIF APP1 and copy only within its declared length.
- uncompressed rows go through crate::unpack (read_u16s / unpack_msb), as in dng.rs
- lossy JPEG tiles (34892) use tiffraw::lossy_jpeg_with_tile (zune-jpeg) with its tile-size checks
- line-dng now implies dng instead of pulling in image
- tests: every layout and compression read against the full reader, refusals, unpack depths
decode_display_part refused a part whose data window across all channels
exceeded max_bytes, even when the kept planes fit. The EXR crate decompresses
one block at a time, so bound the largest all-channel block (a tile within the
data window, or one scan-line group across it) instead. Large multi-layer
files whose picture planes fit now decode; the selected-plane and file
capacity checks are unchanged.