Commit Graph
3074 Commits
Author SHA1 Message Date
FredApps b6d9bd3b37 Merge remote-tracking branch 'origin/main' into w1616 2026-11-16 01:25:04 +01:00
FredApps 95d3f180c0 Merge pull request #1624 from storytold/codex/aaf-compat-schema
aaf: support compatible reference and locator conventions
2026-11-16 01:24:56 +01:00
FredApps a5a713d2e6 Merge remote-tracking branch 'origin/main' into image-codecs/jpeg-stored-inks 2026-11-16 01:21:38 +01:00
Dylan M. Taylor e6a9bcf338 Adapt attributed FilmCraft DNG raw history to shared line decoder
Preserve path-scoped source ancestry, original contributor authors, messages and dates; retain reviewed shared APIs and final integration tree.
2026-11-15 19:19:49 -05:00
FredApps 1f1211fe64 Merge pull request #1077 from vangel76/dng-decode-plus
#1065: DNG raw settings, faster decode, opcode lists, lossy JPEG DNG
2026-11-15 19:19:49 -05:00
Dylan M. Taylor 5e5c0cf874 dng: reject zero or over-16-bit sample depths before unpacking (#4192)
unpack accepted a bit depth of 0: the input requirement became zero bytes,
so one source byte produced a header-sized buffer of zero samples. Depths
outside 1..=16 (the u16 output range) are now rejected up front.
2026-11-15 19:19:49 -05:00
vangel76andClaude Sonnet 5.5 41801059b3 Address review: lossy JPEG channel check, opcode opt-in in develop_with, writer errors
- raw: a lossy JPEG tile must have as many components as SamplesPerPixel.
- process::develop_with: use the opcode lists only when apply_opcodes is set.
- writer: lossy_jpeg returns an error instead of an empty chunk or an encoder panic; new try_write rejects unsupported sample counts and bits/CFA options for lossy JPEG.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
vangel76andClaude Sonnet 5.5 b8a3f828a1 Merge upstream/main into dng-decode-plus
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
vangel76andClaude Sonnet 5.5 2f093b0e2b dng: restore rayon import in raw.rs after merge
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
vangel76andClaude Sonnet 5.5 206f2b0485 Merge upstream/main into dng-decode-plus
Move the new DNG integration tests into the shared tests/it binary.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
vangel76andClaude Opus 5.5 589d84d0f4 #1065: lossy JPEG DNG (Compression 34892)
Problem: lossy DNGs (DNG 1.4 Compression 34892, used for proxy and
"lossy compressed" DNGs, 8-bit LinearRaw tiles usually with a
LinearizationTable) were refused as unsupported.

Fix: decode each tile or strip with the baseline JPEG decoder the
workspace already depends on (`image` with only its jpeg feature, as in
crates/codecs and crates/media; no new crate in Cargo.lock, builds for
wasm32), one component as greyscale or three as colour, the samples
filling the chunk in raster order as with lossless JPEG. As the spec
allows it only for 8-bit LinearRaw, CFA or other depths are refused with
a message naming lossy JPEG. The decoder runs under catch_unwind with an
allocation limit, its picture must match the chunk, and a tiny file
cannot claim a huge picture (at least two bits per 8 x 8 block). Info
reports "lossy JPEG". The test writer gains a lossy JPEG path through
`image`'s encoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
vangel76andClaude Opus 5.5 eb5844d4da #1065: faster DNG decode and development, reduced-resolution path
Problem: a 4096 x 2160 12-bit lossless-JPEG CinemaDNG frame took about
50 ms (tiles) to 115 ms (one strip) on 16 threads and about 200 ms on
one, too slow for smooth 4K playback, and every frame was developed at
full size even for small monitors and proxies.

Fix, without changing the output (f32 bit patterns compared):
- Lossless JPEG: one 13-bit lookup gives a code and its difference
  bits together; the bit reader takes eight bytes at once when they
  hold no 0xFF; per-predictor line loops.
- Tiles decode in parallel by bands straight into place; a single
  strip covering the image is used without a copy.
- Normalisation: without black-level deltas, a lookup table per
  CFA / black-level site replaces the per-sample float arithmetic
  (each entry computed by the same expression).
- Demosaic, crop and colour run row by row from the normalised plane
  (no padded copy, no RGB intermediate), with 5 x 5 windows sliding
  along the five mirrored rows; the bilinear (Fast) Bayer demosaic
  sums in the reference order.
- ProcessOptions::target_size now develops Bayer, LinearRaw and mono
  pictures at 1/2, 1/4 or 1/8 size (the smallest covering the
  target) by averaging each colour over the blocks, without demosaic.

The first version is kept as `reference` (feature `writer`, tests and
benchmarks only): tests/equivalence.rs checks identical raw samples and
developed bits over all Bayer phases, both qualities, odd crops,
active areas, linearisation, black deltas, codes above the bit depth,
LinearRaw, mono, other CFAs and tiny pictures; examples/bench.rs times
both interleaved at 1/4/16 threads. Best of 9 under load ~12: tiles
2.5x (1 thread) to 2.9x (16), one strip 2.1-2.6x; half size 3-4x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:19:49 -05:00
c6f4234682 dng: bound lossless-JPEG decoding by the data it has and reject shared tile bytes (#3680)
* dng: bound lossless-JPEG decoding by the data it has and reject shared tile bytes (#2776)

Remaining amplification holes after the decoded-sample cap: the per-chunk
decode cap had 256 Ki samples of slack on top of the chunk's size, a patched
frame header could ask for far more samples than the entropy-coded bytes can
hold (zero bits were fed past the end), and strips/tiles pointing at the same
bytes were each decoded in full.

ljpeg::decode now fails with Truncated when width*height*components needs more
than one bit per sample of the remaining data, the caller caps at exactly the
chunk's sample count, and raw::chunks rejects overlapping strip/tile ranges.

Tested with a tiny lj92 stream whose SOF is patched to 512x512 and a tiled
file whose second tile reuses the first tile's bytes.

Fixes #2776

* dng: keep the slack for a lossless JPEG coded larger than its chunk

The entropy-length bound already caps the allocation; a last strip coded at
full RowsPerStrip holds more samples than the chunk needs and is truncated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:19:48 -05:00
Earl Co 56ac43a7f1 security(dng): bound tile decoding and IFD traversal (#2952) 2026-11-15 19:19:48 -05:00
vangel76andClaude Opus 5.5 953cb7ef3c #1065: clean-room DNG / CinemaDNG decoder crate
Problem: camera RAW is at 0% (docs/codec-parity.md, #383). CinemaDNG,
the one cinema RAW format with a public specification, could not be
read at all.

Fix: new L0 crate filmcraft-dng, written from the public DNG 1.4-1.7,
TIFF 6.0 / TIFF-EP, ITU-T T.81 and CinemaDNG specifications only (no
other decoder's source read; editions in the crate README):
- TIFF container with SubIFDs, bounded (64 IFDs, 4 levels, cycles end
  the walk) and checked offsets; the main raw IFD is the largest
  NewSubFileType 0 CFA / LinearRaw image.
- Raw data: 1-16-bit uncompressed (MSB-first packing) and lossless JPEG
  (process 14, predictors 1-7, 1-4 components, point transform, line
  restarts), strips and tiles, tiles decoded in parallel; allocations
  capped by size and by the data present.
- Processing per the DNG model: ActiveArea, LinearizationTable, per-site
  black levels with deltas, white levels, as-shot white balance with
  neutral highlight clipping, Malvar-He-Cutler Bayer demosaic (bilinear
  for other patterns), DefaultCrop, ColorMatrix / CameraCalibration /
  ForwardMatrix with illuminant interpolation, Bradford to linear
  Rec. 709, BaselineExposure; output scene-linear RGBA floats.
- CinemaDNG FrameRate, TimeCodes and ReelName tags.
- A test-only writer (feature `writer`) synthesises DNGs. Tests: raw
  samples bit-exact for every depth / predictor / layout, processing
  against hand-computed values, hostile files (every truncation, 12k
  mutations, cyclic IFDs, huge sizes, bad offsets), and LibRaw's
  unprocessed_raw as an external oracle reading the same samples
  (skipped when not installed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:19:48 -05:00
FredApps 4444eaa13c Merge pull request #1684 from storytold/codex/xml-strict-attributes
Reject duplicate attributes in strict XML reads
2026-11-16 01:15:55 +01:00
FredApps 38b5ba8b7d Merge remote-tracking branch 'origin/main' into w-r-shx
# Conflicts:
#	Cargo.toml
2026-11-16 01:15:16 +01:00
FredApps a997649d15 Merge remote-tracking branch 'origin/main' into w-r-pr-solidcraft-format 2026-11-16 01:15:09 +01:00
FredApps 3d09cb9ab9 Merge remote-tracking branch 'origin/main' into w-r-codex/legacy-exif-orientation 2026-11-16 01:15:06 +01:00
FredApps 69e12fd903 Merge pull request #1783 from storytold/fredapps/raw-linearization-table-init
raw: fix the dngwrite test build after #1745
2026-11-16 01:14:21 +01:00
FredApps 920c745f42 raw: initialize linearization_table in the dngwrite test image 2026-11-16 01:13:47 +01:00
FredApps 159d7134d0 fix(image-codecs): read the JPEGs zune-jpeg panics on with craft-jpeg
zune-jpeg 0.5 asserts in its upsampler on some subsampled four-component
frames whose first component isn't the largest. decode now catches that
panic and reads the file with craft-jpeg, as it reads arithmetic-coded and
12-bit files. Refs #778.
2026-11-16 01:13:19 +01:00
FredApps 030a9dda15 Merge pull request #1765 from storytold/extract/light-http-url
http-url: extract bounded HTTP URL and redirect syntax from LightCraft
2026-11-16 01:12:20 +01:00
FredApps eeb134def2 Merge pull request #1769 from storytold/extract/bounded-cube-3d
cms: share bounded 3D Cube profile parsing
2026-11-16 01:12:10 +01:00
FredApps 2d4b8b8ecd Merge pull request #1679 from storytold/codex/avif-source-depth
Expose source bit depth from AVIF decode
2026-11-16 01:11:58 +01:00
FredApps a61b1ad53c fix(image-codecs): JPEG inks of frames zune-jpeg panics on are an error 2026-11-16 01:05:44 +01:00
FredApps 22d34abc0f Merge pull request #1690 from storytold/codex/format-owned-archive
Keep format container bytes in the ZIP archive
2026-11-16 00:55:31 +01:00
FredApps aa9ecc2be4 Merge pull request #1668 from storytold/codex/shared-raw-tiff-hint
Share legacy TIFF camera RAW classification
2026-11-16 00:54:25 +01:00
FredApps 3434d18db4 Merge pull request #1613 from storytold/codex/shared-webp-inspection
Share WebP header inspection
2026-11-16 00:54:11 +01:00
FredApps d0bba656d1 Merge remote-tracking branch 'origin/codex/legacy-exif-orientation' into w-1613
# Conflicts:
#	crates/image-codecs/src/lib.rs
2026-11-16 00:53:34 +01:00
Dylan M. Taylor ea4f63d574 fix: lock optional AVIF threading dependencies 2026-11-15 18:52:41 -05:00
FredApps 927eabc6e6 feat(image-codecs): a JPEG's declared size from its headers, as zune-jpeg reads them 2026-11-16 00:52:35 +01:00
FredApps a6c3feafd9 Merge remote-tracking branch 'origin/codex/legacy-exif-orientation' into w-1668 2026-11-16 00:50:40 +01:00
FredApps 2c2fcd1a28 image-codecs: cover the legacy Sony lossless YCbCr rule and skipped directories 2026-11-16 00:50:39 +01:00
Dylan M. Taylor c599f64832 Merge pull request #1662 from vangel76/perf/raw-ljpeg-nef-1655
CR2, DNG, ARW lossless-JPEG and NEF/RW2 Huffman raw decoding is up to 2x as fast
2026-11-15 18:49:54 -05:00
FredApps 46e163fe4a Merge pull request #1612 from storytold/codex/shx-neutral-reader
Share bounded SHX container reader
2026-11-16 00:49:25 +01:00
FredApps 68a3be432e Merge pull request #1615 from storytold/codex/shx-neutral-glyph
Share bounded SHX glyph program interpreter
2026-11-16 00:49:12 +01:00
FredApps 69c0ff7068 Merge remote-tracking branch 'origin/main' into w-codex/omf-bounds 2026-11-16 00:48:12 +01:00
FredApps e91d97e32d Merge remote-tracking branch 'origin/codex/shared-pcm-essence' into w-codex/omf-bounds
# Conflicts:
#	crates/aaf/tests/bento_api.rs
2026-11-16 00:48:12 +01:00
Dylan M. Taylor 0fd30aeb3e Merge pull request #1771 from storytold/cutover/light-print-raster
pdf: add bounded multi-image 16-bit print raster writer
2026-11-15 18:48:04 -05:00
FredApps 2c740f3292 Merge pull request #1746 from storytold/extract/usd-int-write
Extract bounded USD Crate integer delta encoding
2026-11-16 00:46:40 +01:00
FredApps 19e3dbb606 Merge pull request #1744 from storytold/extract/usd-lz4-write
Share bounded USD Crate LZ4 compression
2026-11-16 00:46:01 +01:00
FredApps 473753b58c feat(image-codecs): read four-component JPEGs as stored inks
A jpeg_inks module for apps that keep a CMYK JPEG's inks the way zune-jpeg
readers gave them: every four-component file taken as Adobe-inverted, YCCK
turned into CMYK as libjpeg does (truncating), only the 8-bit Huffman frames
zune-jpeg decodes (arithmetic-coded and 12-bit files are refused), within
Limits. Also the frame's component count and the assembled ICC profile from
the headers alone. Refs #778.
2026-11-16 00:44:58 +01:00
FredApps b24a1ee25c Merge pull request #1745 from storytold/fix/raw-dng-lin-before-opcodes
raw: leave LinearizationTable unapplied when OpcodeList1 is present
2026-11-16 00:44:49 +01:00
FredApps 5b74db07d1 Merge remote-tracking branch 'origin/main' into w-pr-solidcraft-format 2026-11-16 00:42:01 +01:00
FredApps 9e4431f9fa format: test the build-script lists and newer-file warnings, report and restore 2026-11-16 00:42:00 +01:00
FredApps 4216b943ed Merge remote-tracking branch 'origin/main' into w-codex/shared-raw-video 2026-11-16 00:40:36 +01:00
FredApps dd46f41b9a video: cover every raw layout, label and v210/planar path 2026-11-16 00:40:34 +01:00
Dylan M. Taylor e3b9c10ee0 Merge pull request #1263 from keithcsqueensu/xlsb-styles
craft-xlsx: read the styles part of a binary workbook
2026-11-15 18:39:26 -05:00
FredApps 010d1c1f00 Merge remote-tracking branch 'origin/main' into image-codecs/probe-size-png-jpeg-tiff
# Conflicts:
#	crates/image-codecs/src/lib.rs
2026-11-16 00:38:11 +01:00