Commit Graph
17 Commits
Author SHA1 Message Date
6afd603e53 Merge main into #7377 (Fujifilm compressed RAF)
Only the doc status lines, histories and raw tables conflicted. The
status lines take main's with the #7377 entry kept first; histories keep
both sides. The RAF table row keeps this PR's compressed support next to
main's new Hasselblad 3FR row and its sidecar status, and points at the
moved test file tests/it/raf.rs. The Camera RAW row keeps main's 3FR and
Nikon text and no longer lists compressed RAF as open.

Co-Authored-By: Yorgos S. <smyrgeorge@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:35:13 +01:00
ba3ea95007 raw: honour ActiveArea in Hasselblad 3FR/FFF (PR #9058)
The decoder set the active area and the crop to the whole plane and never
read ActiveArea, so a file with masked borders and no DefaultCrop developed
with the borders in. Read ActiveArea like the DNG path, use it as the
initial crop, and place DefaultCrop relative to it as DNG does. Also give
3FR/FFF its own row in the camera raw table instead of "embedded preview
only".

Co-Authored-By: Gotya-OFFCIAL <Gotya-OFFCIAL@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 19:39:30 +01:00
David Mann b8b539c845 Merge origin/main into PR #9058 (raw: Hasselblad 3FR/FFF) 2026-11-07 19:37:23 +01:00
b9323e117e Merge main into #7377 (Fujifilm compressed RAF)
Main moved crates/raw/src/testgen.rs into testgen/ and the integration
tests into tests/it/, and its preview fallback now also opens a larger
JPEG XL preview. The compressed RAF test generator moves to
testgen/raf.rs; the JPEG fallback and the damaged-data fallback both go
through preview_image (Adobe RGB tag from the EXIF) under the caller's
decode limits. Doc status lines and histories keep both sides; G14 and
the Camera Raw row no longer list compressed RAF as missing.

Co-Authored-By: Yorgos S. <smyrgeorge@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:43:08 +01:00
Gotya-OFFCIAL e7241d2e26 raw: decode Hasselblad 3FR/FFF (X2D II 100C, uncompressed)
The X2D II 100C's 3FR files develop at full sensor resolution instead of
falling back to the camera's embedded JPEG preview. A 3FR is a TIFF whose
IFD0 holds the camera's JPEG and whose CFA image sits in a SubIFD with
DNG-style tags but no DNGVersion and no CFA-pattern tag (neither the
TIFF/EP pair nor the EXIF one), which is why the generic TIFF/EP path
reported "CFA pattern not recorded". The new decoder reuses the shared
strip reader, takes BlackLevel, WhiteLevel, DefaultCropOrigin/Size and
AsShotNeutral from the file, and takes the Bayer phase from a measured
per-body table (the X2D II 100C: RGGB at the data origin, measured
against the camera's own embedded JPEG; unmeasured bodies warn).
Lossless-JPEG 3FR stays preview-only, like uncompressed-only ORF and RAF
before it.

Clean-room: the TIFF 6.0 and DNG specifications, the sample file's bytes
and its embedded JPEG; no code or tables from dcraw, LibRaw, rawspeed,
rawler or darktable.

Adds round-trip and hostile tests through a mirrored synthetic builder
(tests/it/hasselblad.rs, testgen::Hasselblad3frSpec) and updates the
support matrix (file-format-parity, gaps G14, target-app-parity).
2026-11-06 12:05:10 +08:00
texjer 7ce4804b76 Merge remote-tracking branch 'upstream/main' into feat/cr2-sraw
# Conflicts:
#	crates/raw/src/lib.rs
2026-11-04 22:01:15 -05:00
Dylan M. Taylor c004e38e75 raw: decode a tile range once when several tiles share it (#11041)
read_plane decoded every segment separately, even when a file pointed
every tile at the same bytes. Each lossless JPEG decode rebuilds its
Huffman tables and each result is retained until assembly, so one small
range repeated across many tiles multiplied header work and memory by
the tile count.

Decode each distinct (offset, length, geometry) once and scatter the
shared samples into every tile that names it.
2026-11-03 20:37:28 -05:00
FredApps fd3a12dfde Merge approved PhotoCraft PR #3142: Read applied Sony RAW metadata and crop ILCE-6000 images
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Integrate bounded Sony SR2 metadata decoding and ILCE-6000 image area; preserve newer bit-depth-aware camera profile application and explicit file crop precedence. Keep current parity counts and original metadata/crop tests.
2026-10-29 06:38:44 +01:00
texjer fd601d7807 feat(raw): decode Canon sRAW / mRAW CR2 as camera RGB
Canon's subsampled lossless JPEG (Y 2x2 or 2x1, Cb/Cr per MCU) with its
own prediction chain, de-sliced into YCbCr planes, bilinear chroma, a
BT.601 inverse and the per-shot sRAW gains from ColorData (version 15),
developed like a three-sample LinearRaw so white balance, the fitted
camera look, tone and the Camera Raw dialog all apply. Verified on EOS
6D Mark II mRAW files; other bodies decode with a warning when their
gain offset is unknown.
2026-10-28 14:04:01 -04:00
vangel76andClaude Sonnet 5.5 3e144a381a Merge upstream/main into perf/9434-fused-develop
Main reverted the #9455 merge, so a plain merge would drop the band-by-band
develop; keep this PR's demosaic.rs, develop.rs and development_limits.rs and
take all other upstream changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 01:18:21 +01:00
David Mann 0134d2dc70 Revert "Merge PR #9455: raw: develop the default rendering band by band, without the f32 RGB frame"
This reverts commit ddb92be1fa, reversing
changes made to f12be92413.
2026-10-25 18:38:22 +01:00
David Mann 34310d5ba6 Merge PR #8402: Raw: open lossy DNGs (floating-point JPEG XL raw data), and fall back to the JPEG XL preview, not the tiny thumbnail (fixes #8125) 2026-10-25 15:05:48 +01:00
dcf5c61a64 Integration: cap MapPolynomial opcodes, finite WhiteLevel, RGB-only JPEG XL preview (#8402)
- An opcode list may hold up to 4096 opcodes, and every MapPolynomial is checked for every
  sample, so a crafted DNG with thousands of whole-image polynomials (a few hundred KB) hung the
  open for minutes. Keep at most 64 per list; the rest are named as not applied.
- A DOUBLE WhiteLevel past f32::MAX became an infinite white, which blacked out that channel.
  A non-finite level now falls back to the default, as a zero one does.
- A reduced-resolution LinearRaw IFD (NewSubFileType 1, three samples, JPEG XL) was a JPEG XL
  preview candidate, and its undeveloped samples would show as an sRGB picture. Previews now
  need PhotometricInterpretation RGB or YCbCr.
- README: floating-point JPEG XL raw data and OpcodeList2 MapPolynomial are supported.

Co-authored-by: SBaksa <18648812+SBaksa@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 14:55:45 +01:00
vangel76andClaude Sonnet 5.5 dc791a43de raw: develop the default rendering band by band without the f32 RGB frame
When neither Dehaze, a local tone slider nor a camera black point is in play, no
statistic of the whole frame is needed, so the demosaic output no longer has to be
kept. Every band is demosaiced into a small band buffer and encoded straight into the
u16 output. The f32 RGB frame (12 bytes a pixel, 545 MB at 45 MP) and the pass that
read it back are gone. A Bayer sensor also skips the padded CFA plane: each band
normalizes the rows it reads (with the mirrored borders) into a small window. X-Trans
keeps its plane and green plane, LinearRaw has none. Tone, Dehaze and black points
keep the full-frame path.

The bands are the ones the full-frame path computes, with the same arithmetic per
pixel, so the output is bit-identical (tests compare both paths for Bayer, X-Trans and
LinearRaw, odd sizes, band borders, orientations and 1, 3 and 16 threads).
working_memory now charges what each path really holds.

Fixes #9434

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 14:35:29 +01:00
vangel76andClaude Sonnet 5.5 97a719a7a7 raw: a non-finite black level no longer panics the AHD demosaic
A DNG whose BlackLevel is a DOUBLE beyond f32 reads as inf. The periodic
fill then computed (raw - inf) * 0 = NaN, and AHD's f32::clamp with NaN
bounds asserts. The fill now returns (0, 0) for a non-finite black, as
Scale::value does, and AHD uses a compare-and-select clamp that gives the
same result for every non-NaN bound.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 13:58:12 +01:00
SBaksa 319cb299d2 Merge remote-tracking branch 'origin/main' into dng-lossy-open 2026-10-23 10:49:33 +11:00
aiongg a6428d3dfb Build each crate's integration tests as one binary
Every tests/*.rs file is its own executable that links the whole crate
graph. Move each crate's test files into tests/it/ as modules of one
tests/it/main.rs; helper modules under tests/common move with them.

These keep their own binary (own process):
- engine panic_hunt: a process-wide panic hook counts every panic.
- engine text_gamma: changes the process-wide text gamma.
- engine smart_filter_stages, mask_cache_purge: assert on global caches.
- codecs pnm_peak_memory: reads the process's peak RSS.
- photocraft mac_menu_appkit: harness = false.
2026-10-22 16:55:34 +00:00