Commit Graph
15 Commits
Author SHA1 Message Date
FredApps 1b71cd1c18 Merge pull request #1667 from storytold/codex/sgi-main-reconcile
Reconcile SGI codec with merged JPEG-LS support
2026-11-16 01:26:24 +01:00
FredApps 59b4f1e8c2 image-codecs: decode AVIF pixels with the pure-Rust AV1 decoder (#778) (#1601)
* image-codecs: decode AVIF pixels with craft-video's pure-Rust AV1 decoder

New optional `avif-decode` feature (native targets) reads still AVIF
files: the HEIF/ISOBMFF item graph, grids, clap/irot/imir, alpha
auxiliary images (including premultiplied), 8/10/12-bit 4:0:0, 4:2:0,
4:2:2 and 4:4:4, nclx/ICC colour, Exif and XMP, and PQ/HLG to linear
F32 through cicp::linearize as the HEIF path does.

The container walk follows LightCraft #3017 by @emmertex. Every size is
checked against the caller's Limits before the AV1 decoder runs, the
decoder's memory budget is capped by max_alloc, and the decode is
wrapped in catch_unwind so a decoder panic becomes an error.

Fixtures are tiny ffmpeg/libaom files; the 4:2:0 planes match libdav1d
bit for bit. Adds a decode_avif fuzz target.

Part of storytold/craft-libs#778.

* image-codecs, video: address review on the AVIF decoder

- clap: width and height are unsigned fractions, the offsets have signed
  numerators, so 0x80000000/0x40000000 is a width of 2, not -2.
- An item with clap, irot or imir more than once (repeated ipma records)
  is refused before any canvas work, instead of rotating 261120 times.
- Matrix coefficients 10 (BT.2020 constant luminance) is refused rather
  than converted with the non-constant-luminance equations.
- An alpha plane whose own transforms differ from the colour's is refused
  rather than composed in the wrong place; none, or the colour's, still
  decode.
- craft-video: Decoder::set_shown_budget lowers the per-chunk byte cap on
  shown pictures (never above 1 GiB), and the AVIF decoder sets it to
  max_alloc, so a payload of many shown pictures is refused before they
  are built.
2026-11-15 23:25:25 +01:00
Dylan M. Taylor 90df9a4d99 Gate SGI codec support behind explicit feature 2026-11-15 17:28:29 +00:00
Dylan M. Taylor 9f18482853 Merge remote-tracking branch 'origin/main' into codex/sgi-main-reconcile
# Conflicts:
#	crates/image-codecs/README.md
#	crates/image-codecs/src/format.rs
#	crates/image-codecs/src/lib.rs
#	crates/image-codecs/tests/it/detect_caps.rs
2026-11-15 17:26:03 +00:00
Dylan M. Taylor f5a22a008c Merge pull request #1576 from el-j/feat/image-codecs-jpegls
craft-image-codecs: JPEG-LS reader and writer
2026-11-15 12:22:57 -05:00
Dylan M. Taylor c393428049 Merge pull request #1461 from storytold/fix/png-bounded-row-stream
image-codecs: bound PNG row streaming without a full-frame allocation
2026-11-15 11:01:29 -05:00
el-j 3ce92b332d craft-image-codecs: JPEG-LS (ITU-T T.87) reader and writer
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
2026-11-15 12:53:20 +01:00
el-j 2e3ff2162b craft-image-codecs: SGI image reader and writer
Adds Format::Sgi: 8- and 16-bit gray, gray+alpha, RGB and RGBA, verbatim
and run-length encoded on read, run-length encoded on write.
Palette-mapped files are reported as unsupported.

Closes #1559
2026-11-15 11:44:48 +01:00
.CooCoo b63198042b craft-image-codecs: check the deep EXR corpus against pinned SHA-256 values (#1487)
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.
2026-11-15 04:11:00 -05:00
Dylan M. Taylor c0ce055384 image-codecs: bound PNG row streaming independently of full output 2026-11-14 20:04:36 -05:00
Dylan M. Taylor c2a69bbdc6 Preserve unmarked CMYK JPEG samples 2026-11-14 13:23:47 +00:00
aiongg ea1c84290d image-codecs: list InkSet and ExtraSamples on TiffPage (#1307)
* image-codecs: list InkSet and ExtraSamples on TiffPage

* image-codecs: TiffPage InkSet and ExtraSamples as enums

* image-codecs: InkSet::InkNames, and Invalid for undefined tag values
2026-11-14 07:18:01 -05:00
Dylan M. Taylor 1532c43674 Align EXIF thumbnail test with shared metadata 2026-11-13 07:33:07 -05:00
Dylan M. Taylor 3bdf0eaadd Format shared image codec crate 2026-11-13 00:17:35 -05:00
Dylan M. Taylor 9430f2807e Add shared image codec facade 2026-11-13 00:17:04 -05:00