diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 1231221b..81e900ae 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -62,7 +62,7 @@ impl SettingsHashes { } /// Bump when the pipeline's output changes, to invalidate cached thumbnails. -pub const RENDER_CACHE_VERSION: u64 = 22; +pub const RENDER_CACHE_VERSION: u64 = 26; /// Thumbnails render at one of these long edges (so window/cell size changes reuse the cache). pub const THUMB_SIZES: [usize; 4] = [128, 256, 384, 512]; diff --git a/crates/raw/src/vendor/arw.rs b/crates/raw/src/vendor/arw.rs index 7c299046..32a45f25 100644 --- a/crates/raw/src/vendor/arw.rs +++ b/crates/raw/src/vendor/arw.rs @@ -42,6 +42,10 @@ const REFERENCE_BLACK_WHITE: u16 = 532; /// Maker-note tags (ExifTool Sony tag names): the enciphered `Tag2010` block and `FullImageSize` (height, width). const MN_TAG2010: u16 = 0x2010; const MN_FULL_IMAGE_SIZE: u16 = 0xb02b; +/// Maker-note `FileFormat` (ExifTool Sony tag names): `1 0 0 0` is SR2, `2 0 0 0` ARW 1.0, `3 …` and later ARW 2.x+. +/// The DSC-R1's SR2 stores 16-bit samples that are spread uniformly over 2–65340 (median ~33000, three quarters +/// above any white level): encrypted, so it is refused and opens from its preview instead of decoding to noise. +const MN_FILE_FORMAT: u16 = 0xb000; /// Inverse of Sony's maker-note byte substitution. ExifTool's Sony tag documentation states that the data of /// tags `0x2010`, `0x9050` and `0x94xx` "is encrypted by a simple substitution cipher" (no decoder source was @@ -413,11 +417,8 @@ fn sr2_black_levels(cipher: &[u8], order: lightcraft_tiff::ByteOrder) -> Option< } /// The image area for files without Sony's crop tags (`0x74c7/0x74c8`, written since about 2017): the DNG-style -/// default crop when the raw IFD has one, else the maker note's `FullImageSize` (the camera JPEG's size) anchored -/// at the top-left. Older bodies store a few columns of padding at the right edge of the raw frame (constant -/// values, 8–32 columns on the samples we checked) inside a frame 16–48 pixels wider than `FullImageSize`, so -/// the anchored crop removes them while keeping the CFA phase. -fn default_crop(raw: &Ifd, mn: Option<&makernote::MakerNote>, w: usize, h: usize) -> Rect { +/// default crop when the raw IFD has one, else the image size the camera records (see [`recorded_size_crop`]). +fn default_crop(raw: &Ifd, mn: Option<&makernote::MakerNote>, exif_size: Option<(u64, u64)>, w: usize, h: usize) -> Rect { let full = Rect::new(0, 0, w, h); if let (Some([x, y]), Some([cw, ch])) = (raw.u64s(t::DEFAULT_CROP_ORIGIN).as_deref(), raw.u64s(t::DEFAULT_CROP_SIZE).as_deref()) && *cw > 0 @@ -426,14 +427,37 @@ fn default_crop(raw: &Ifd, mn: Option<&makernote::MakerNote>, w: usize, h: usize return Rect::new(*x as usize, *y as usize, *cw as usize, *ch as usize).clipped(w, h); } match mn.and_then(|m| m.ifd.u64s(MN_FULL_IMAGE_SIZE)).as_deref() { - // only a plausible trim: never more than 64 pixels per side, never an enlargement - Some([fh, fw]) if *fw as usize <= w && *fh as usize <= h && *fw as usize + 64 >= w && *fh as usize + 64 >= h => { - Rect::new(0, 0, *fw as usize, *fh as usize) - } + Some([fh, fw]) => recorded_size_crop((*fw, *fh), exif_size, w, h).unwrap_or(full), _ => full, } } +/// The crop for the maker note's `FullImageSize` `full` (width, height: the camera JPEG's size) and the Exif image +/// size `exif` (`PixelXDimension` × `PixelYDimension`) in a `w × h` frame; `None` when they don't describe a crop of +/// it. Older bodies store a few columns of padding at the right edge of the raw frame (constant values, 8–32 columns +/// on the samples we checked) inside a frame 16–48 pixels wider than `FullImageSize`, so the crop is anchored at +/// the left, which removes them while keeping the CFA phase. In the camera's 3:2 mode it is also anchored at the +/// top. An in-camera aspect ratio narrower than the frame (16:9) is centred vertically, as measured by registering +/// each camera JPEG on its raw (the ILCE-7SM2's 4240 × 2384 at y 228–232 of 2848; the DSLR-A580's 4912 × 2760 at +/// y 258–262 of 3280; issue #535): its height comes from `FullImageSize` (ILCE-7SM2) or, when that still says +/// 3:2, from an Exif image size of the same width (DSLR-A580). +fn recorded_size_crop(full: (u64, u64), exif: Option<(u64, u64)>, w: usize, h: usize) -> Option { + let (fw, fh) = (usize::try_from(full.0).ok()?, usize::try_from(full.1).ok()?); + // only a plausible trim of the width: never more than 64 pixels, never an enlargement + if fw == 0 || fh == 0 || fw > w || fw.saturating_add(64) < w || fh > h { + return None; + } + let height = match exif.and_then(|(ew, eh)| Some((usize::try_from(ew).ok()?, usize::try_from(eh).ok()?))) { + Some((ew, eh)) if ew == fw && eh > 0 && eh < fh => eh, + _ => fh, + }; + if height.saturating_add(64) >= h { + return Some(Rect::new(0, 0, fw, height)); + } + // an in-camera aspect ratio: at least half the frame's height, centred (an even offset keeps the CFA phase) + (height * 2 >= h).then(|| Rect::new(0, ((h - height) / 2) & !1, fw, height)) +} + fn raw_ifd(tiff: &Tiff) -> Option<&Ifd> { tiff.all_ifds() .into_iter() @@ -445,6 +469,13 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result { let tiff = Tiff::parse(bytes)?; let ifd0 = &tiff.ifds[0]; let raw = raw_ifd(&tiff).ok_or_else(|| RawError::Unsupported("ARW without a CFA image IFD (old ARW or SR2)".into()))?; + let mn = tiff + .exif() + .and_then(|e| e.get(t::MAKER_NOTE)) + .and_then(|e| makernote::parse_makernote(bytes, e.offset, e.count() as u64, tiff.order, &ifd0.string(t::MAKE).unwrap_or_default())); + if mn.as_ref().and_then(|m| m.ifd.u64s(MN_FILE_FORMAT)).as_deref() == Some(&[1, 0, 0, 0]) { + return Err(RawError::Unsupported("Sony SR2 (DSC-R1): the raw data is encrypted, not decoded yet".into())); + } let info = raw.image()?; let (w, h) = (info.width as usize, info.height as usize); if w * h > crate::MAX_SAMPLES { @@ -519,10 +550,6 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result { raw.f64(t::WHITE_LEVEL).map(|v| v as f32).filter(|v| *v > 0.0).unwrap_or_else(|| super::white_from_data(samples, scale_bits)) }; let model = ifd0.string(t::MODEL).unwrap_or_default(); - let mn = tiff - .exif() - .and_then(|e| e.get(t::MAKER_NOTE)) - .and_then(|e| makernote::parse_makernote(bytes, e.offset, e.count() as u64, tiff.order, &ifd0.string(t::MAKE).unwrap_or_default())); let wb = raw .f64s(WB_RGGB) .filter(|v| v.len() == 4 && v[1] > 0.0 && v[0] > 0.0 && v[3] > 0.0) @@ -533,7 +560,10 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result { .or_else(|| mn.as_ref().and_then(|m| tag2010_wb(&model, m.ifd.bytes(MN_TAG2010)?, m.order))); let crop = match (raw.u64s(CROP_TOP_LEFT).as_deref(), raw.u64s(CROP_SIZE).as_deref()) { (Some([x, y]), Some([cw, ch])) if *cw > 0 && *ch > 0 => Rect::new(*x as usize, *y as usize, *cw as usize, *ch as usize).clipped(w, h), - _ => default_crop(raw, mn.as_ref(), w, h), + _ => { + let exif_size = tiff.exif().and_then(|e| Some((e.u64(t::PIXEL_X_DIMENSION)?, e.u64(t::PIXEL_Y_DIMENSION)?))); + default_crop(raw, mn.as_ref(), exif_size, w, h) + } }; let mut metadata = lightcraft_meta::from_tiff(&tiff); metadata.width = Some(crop.width as u32); @@ -599,6 +629,64 @@ mod tests { assert_eq!((developed.width, developed.height), (4, 4)); } + #[test] + fn recorded_size_crops_in_camera_aspect_ratios() { + // 3:2: anchored at the top-left, as before (ILCE-7S, DSLR-A700 whose Exif size is the whole frame) + assert_eq!(recorded_size_crop((4240, 2832), Some((4240, 2832)), 4288, 2848), Some(Rect::new(0, 0, 4240, 2832))); + assert_eq!(recorded_size_crop((4272, 2848), Some((4288, 2856)), 4288, 2856), Some(Rect::new(0, 0, 4272, 2848))); + assert_eq!(recorded_size_crop((4240, 2832), None, 4288, 2848), Some(Rect::new(0, 0, 4240, 2832))); + // 16:9 from FullImageSize (ILCE-7SM2) and from the Exif size when FullImageSize says 3:2 (DSLR-A580): centred + assert_eq!(recorded_size_crop((4240, 2384), Some((4240, 2384)), 4288, 2848), Some(Rect::new(0, 232, 4240, 2384))); + assert_eq!(recorded_size_crop((4912, 3264), Some((4912, 2760)), 4928, 3280), Some(Rect::new(0, 260, 4912, 2760))); + // offsets stay even (CFA phase) + assert_eq!(recorded_size_crop((4240, 2386), None, 4288, 2848).map(|r| r.y), Some(230)); + // not a crop of this frame: wider than it, far narrower, under half its height, empty, hostile values + assert_eq!(recorded_size_crop((4300, 2832), None, 4288, 2848), None); + assert_eq!(recorded_size_crop((4000, 2832), None, 4288, 2848), None); + assert_eq!(recorded_size_crop((4240, 1000), None, 4288, 2848), None); + assert_eq!(recorded_size_crop((0, 2832), None, 4288, 2848), None); + assert_eq!(recorded_size_crop((u64::MAX, u64::MAX), Some((u64::MAX, 1)), 4288, 2848), None); + assert_eq!(recorded_size_crop((4240, 2832), Some((4240, 0)), 4288, 2848), Some(Rect::new(0, 0, 4240, 2832))); + } + + /// A Sony CFA file whose maker note carries only `FileFormat` (tag 0xb000) = `format`. + fn sony_with_file_format(format: [u8; 4]) -> Vec { + use lightcraft_tiff::{IfdBuilder, ImageData, TiffWriter, Value}; + // Sony maker note: 12-byte header, then an IFD (one entry whose 4-byte value is stored inline) + let mut note = b"SONY DSC \0\0\0".to_vec(); + note.extend(1u16.to_le_bytes()); + note.extend(MN_FILE_FORMAT.to_le_bytes()); + note.extend(1u16.to_le_bytes()); // BYTE + note.extend(4u32.to_le_bytes()); + note.extend(format); + note.extend(0u32.to_le_bytes()); + let mut exif = IfdBuilder::new(); + exif.set(t::MAKER_NOTE, Value::Undefined(note)); + let mut raw = IfdBuilder::new(); + raw.set(t::MAKE, Value::Ascii("SONY".into())); + raw.set(t::MODEL, Value::Ascii("DSC-R1".into())); + raw.set(t::IMAGE_WIDTH, Value::Long(vec![8])); + raw.set(t::IMAGE_LENGTH, Value::Long(vec![4])); + raw.set(t::BITS_PER_SAMPLE, Value::Short(vec![14])); + raw.set(t::SAMPLES_PER_PIXEL, Value::Short(vec![1])); + raw.set(t::PHOTOMETRIC, Value::Short(vec![photometric::CFA])); + raw.set(t::COMPRESSION, Value::Short(vec![1])); + raw.set_child(t::EXIF_IFD, exif); + raw.set_image(ImageData::Strips { rows_per_strip: 4, strips: vec![vec![0x10u8; 8 * 4 * 2]] }); + TiffWriter::default().write(&[raw]).unwrap() + } + + #[test] + fn sr2_is_refused_not_decoded_as_noise() { + for mode in [Mode::Header, Mode::Full] { + let err = decode(&sony_with_file_format([1, 0, 0, 0]), mode).unwrap_err(); + assert!(matches!(err, RawError::Unsupported(ref m) if m.contains("SR2")), "{mode:?}: {err:?}"); + // the same file as an ARW 2.x decodes + let ok = decode(&sony_with_file_format([3, 0, 0, 0]), mode); + assert!(ok.is_ok(), "{mode:?}: {ok:?}"); + } + } + /// A 32767-compressed ARW whose single strip is `strip` bytes for a 32 x 4 image. fn arw_with_strip(strip: usize) -> Vec { use lightcraft_tiff::{IfdBuilder, ImageData, TiffWriter, Value}; diff --git a/crates/raw/tests/corpus.rs b/crates/raw/tests/corpus.rs index 5ce32565..3b8b9fa9 100644 --- a/crates/raw/tests/corpus.rs +++ b/crates/raw/tests/corpus.rs @@ -18,6 +18,7 @@ const KNOWN_UNSUPPORTED: &[&str] = &[ "cr3-", // Unverified CRX coding variants; exact supported cases live in cr3_corpus.rs. "orf-olympus-em", // Olympus compressed ORF "sraw", // Canon sRAW / mRAW + "sony-r1-sr2", // Sony SR2 (DSC-R1): encrypted raw data, opens from its preview (#535) ]; #[test] @@ -357,6 +358,45 @@ fn corpus_sony_pre2017_colour_metadata() { eprintln!("pre-2017 Sony ARW colour metadata checked on {seen} files"); } +/// Issue #535: pre-2017 Sony bodies without crop tags shot in the camera's 16:9 mode. The ILCE-7SM2 records the +/// 16:9 size in `FullImageSize`, the DSLR-A580 only in the Exif image size; both crops are centred vertically (each +/// camera JPEG registered on its raw) and drop the right-edge padding, so the image matches its JPEG's aspect ratio +/// and gets a camera look. The DSC-R1's SR2 stores encrypted samples and must open as its preview, not as noise. +#[test] +fn corpus_sony_16x9_crops_and_sr2() { + let dir = corpus_root().join("raw"); + let read = |name: &str| match std::fs::read(dir.join(name)) { + Ok(bytes) => Some(bytes), + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + eprintln!("skip: {name} absent"); + None + } + Err(e) => panic!("{name}: {e}"), + }; + let mut seen = 0; + for (name, (x, y, w, h)) in [("arw-sony-a7sm2-16x9.arw", (0, 232, 4240, 2384)), ("arw-sony-a580-16x9.arw", (0, 260, 4912, 2760))] { + let Some(bytes) = read(name) else { continue }; + let img = decode(&bytes).unwrap_or_else(|e| panic!("{name}: {e}")); + let c = img.crop; + assert_eq!((c.x, c.y, c.width, c.height), (x, y, w, h), "{name}: crop"); + let jpeg = embedded_preview(&bytes).unwrap_or_else(|| panic!("{name}: no preview")); + let mut d = zune_jpeg::JpegDecoder::new(zune_core::bytestream::ZCursor::new(&jpeg)); + d.decode_headers().unwrap(); + let info = d.info().unwrap(); + let (aspect, preview) = (c.width as f64 / c.height as f64, info.width as f64 / info.height as f64); + assert!((aspect / preview - 1.0).abs() < 0.02, "{name}: crop aspect {aspect} vs camera JPEG {preview}"); + seen += 1; + } + if let Some(bytes) = read("arw-sony-r1-sr2.sr2") { + for r in [decode(&bytes).map(|_| ()), probe_info(&bytes).map(|_| ())] { + assert!(matches!(r, Err(RawError::Unsupported(ref why)) if why.contains("SR2")), "DSC-R1 SR2: {r:?}"); + } + assert!(embedded_preview(&bytes).is_some(), "DSC-R1 SR2: no preview to open"); + seen += 1; + } + eprintln!("Sony 16:9 crops and SR2 checked on {seen} files"); +} + /// The embedded JPEG as linear RGB, reduced to `gw × gh` cells. fn jpeg_cells(jpeg: &[u8], gw: usize, gh: usize) -> Vec<[f64; 3]> { use zune_core::{bytestream::ZCursor, colorspace::ColorSpace, options::DecoderOptions}; diff --git a/docs/parity.md b/docs/parity.md index 4c27755b..943aed96 100644 --- a/docs/parity.md +++ b/docs/parity.md @@ -144,7 +144,7 @@ under the UI command that wraps it (a no-op error); the UI command now wins. | LR-IMP-SIDECAR-SPLIT | Separate XMP sidecar variants | P2 | ⬜ | `cmd:library.xmpPreferences` | sidecar naming option exists (stem/full), no split sidecars | | LR-IMP-FORMATS | Supported formats | P0 | 🟡 | `crates/codecs/src/lib.rs`, `crates/raw/src/lib.rs`, `crates/raw/src/jxl.rs` | JPEG, PNG, TIFF (1- to 64-bit integer, 16- to 64-bit float, incl. bilevel and CCITT fax), WebP, JXL, PSD, GIF, BMP; DNG (incl. lossy / Smart Preview DNG and DNG 1.7 JPEG XL tiles/strips: lossless ones decode bit-exactly on synthetic CFA and LinearRaw files, lossy ones are restored to the declared linear primaries without clipping or gamut mapping, checked on one real file with 108 lossy tiles, and any tile that fails to decode makes the file preview-only; a single-chunk JPEG XL preview IFD is offered as the embedded preview), CR2 (colour-filter layout from the file's `CR2CFAPattern` tag, issue #85), ARW (pre-2017 bodies: white balance and black level from enciphered maker-note / `SR2SubIFD` data, issue #148; downsized Sony lossless YCbCr 4:2:0 / 4:2:2 tiles decoded to linear RGB, verified on private ILCE-7M4 3:2 & 4:3 examples including 16-bit full-resolution export), NEF (uncompressed, lossless and lossy compressed 12/14-bit, `crates/raw/src/vendor/nefc.rs`), RAF (uncompressed, lossless/lossy compressed Bayer and X-Trans; `crates/raw/src/vendor/rafc.rs`, full sensor verification on 13 bodies, `docs/raf-compression.md`), RW2 / Leica RWL / Panasonic RAW in every raw format (compressed 4 and 6, the prefix-coded strips of format 8 from the GH6 on, packed 2/5/7, the 16-bit words of the 2005–2007 bodies; black levels, in-camera aspect crops and mapped-out defect pixels; 178 CC0 files from 118 bodies checked, `crates/raw/src/vendor/rw2.rs`), PEF, ORF (uncompressed; colour-filter layout from the file's Exif `CFAPattern`), Hasselblad 3FR with uncompressed raw data (X1D, X1D II, X2D, CFV 100C: a TIFF without a DNG version tag that describes its CFA IFD, levels, crop and white balance with DNG's tags; `RawFormat::CfaTiff`, read by `dng::decode_as`, RGGB when the file states no `CFAPattern`; the lossless-JPEG 3FR and FFF files use scan selection value 8 and stay preview-only), Samsung SRW without compression (NX5, NX10, NX11 and the NX20-generation bodies NX20, NX200, NX210, NX1000 and NX1100 as 12-bit packed samples in either bit order, EX1 and WB2000 as 16-bit words; layout, camera-JPEG framing, levels and white balance from the maker note, `crates/raw/src/vendor/srw.rs`; median ΔE vs the camera JPEG 2.2–7.6 on 11 of the 12 files from 10 bodies checked, 10.7 (5.7 registered) on the backlit WB2000 sample). 12-bit NEF black level: maker note `0x003d` is in 14-bit units (D750, D780, D850, D7500, Z 50 checked). Lossy type 2 NEF curves of version `0x44 0x40` (D780, D6, Z 5, Z 6, Z 7, Z 7_2) span a quarter of the sample range, read from the table's own point spacing. CR3 lossless CRX Bayer and version 0x100/0x200 C-RAW decodes to sensor pixels with timed white balance, black/white levels and file crop (the shot's aspect ratio from the maker note's `AspectInfo`); full sensor samples match the reference on M50/R100/R8 (`crates/raw/tests/cr3_corpus.rs`, `docs/cr3.md`). Unsupported coding variants retain metadata and use the embedded JPEG when available; HEVC preview decoding remains unsupported. Missing: CR3 unverified CRX variants, compressed ORF, compressed Samsung SRW (NX1, NX30, NX300, NX500, NX2000, NX3000, NX3300, NX mini: preview only with the reason), NEFs labelled compressed (34713) but stored uncompressed without a `0x0096` table (Z 6 packed 14-bit, D850 12-bit uncompressed), NEF "lossy after split" (preview only: imported with `preview_only` = the decoder's reason, rendered as a rendered JPEG, flagged by a grid badge and loupe/Edit/Info notices, `previewOnly` in `catalog.query`; Reload clears it once the file decodes), TIFF-based raws whose raw data sits in a private block (Phase One / Leaf IIQ, Canon EOS-1D / 1Ds and Kodak DCS TIFFs: IFD0 is only a reduced RGB image next to a much larger declared picture) are recognised from that structure and import as `preview_only` with the reason, instead of opening as a thumbnail-sized ordinary image (`thumbnail_shell` in `crates/raw/src/lib.rs`), Recognised raws LightCraft cannot decode open as `preview_only` with any usable embedded JPEG, also Canon CRW, Minolta MRW and Sigma X3F (containers recognised by magic, preview found by a structural JPEG scan), Kodak KDC (IFD0 without `ImageWidth`), Leaf MOS and Epson ERF (scan), and any decode failure of a recognised raw, not only an unsupported variant; ones with no JPEG still fail with "without an embedded preview", AVIF decode (HEIC decodes only behind the non-default `heif` feature: `crates/heif`, heic-rs, same policy as PhotoCraft; 8/10-bit, alpha, irot/imir/clap, ICC/EXIF/XMP), palette (indexed-colour) TIFF (refused by the `tiff` crate) | -| LR-IMP-CAMERA-COVERAGE | Camera coverage, verified per model | P0 | 🟡 | `crates/raw/tests/corpus.rs`, `xtask/src/main.rs` | a supported container is not the same as every camera that writes it decoding correctly: ~55 CC0 corpus files plus 6 exact-sensor CR3 cases (plus ~60 NEFs checked by hand and 178 Panasonic / Leica RW2, RWL and RAW files from 118 bodies, checked against each file's own JPEG) against the >1,000 models Lightroom lists; per-model differences still surface (e.g. the CR2 colour-filter layout differed by model until it was read from the file's own tag, issue #85, checked on 35 CR2 bodies; pre-2017 Sony ARWs opened green until their scrambled white balance / black level were read, issue #148, checked on 16 ARWs from 15 Sony bodies; Canon PowerShot and EOS M CR2s whose `ColorData` is stored as bytes opened green until the bytes were read as 16-bit words, 25 files from 25 bodies checked). Compressed RAF sensor arrays verified on 13 Fujifilm bodies (`docs/raf-compression.md`). Grow the CC0 corpus per model and test each sample decodes with plausible colour. Nikon CropArea and untagged-preview colour-space regression tests; private Z 8 crop verified. | +| LR-IMP-CAMERA-COVERAGE | Camera coverage, verified per model | P0 | 🟡 | `crates/raw/tests/corpus.rs`, `xtask/src/main.rs` | a supported container is not the same as every camera that writes it decoding correctly: ~55 CC0 corpus files plus 6 exact-sensor CR3 cases (plus ~60 NEFs checked by hand and 178 Panasonic / Leica RW2, RWL and RAW files from 118 bodies, checked against each file's own JPEG) against the >1,000 models Lightroom lists; per-model differences still surface (e.g. the CR2 colour-filter layout differed by model until it was read from the file's own tag, issue #85, checked on 35 CR2 bodies; pre-2017 Sony ARWs opened green until their scrambled white balance / black level were read, issue #148, checked on 16 ARWs from 15 Sony bodies; pre-2017 Sony bodies shot in the camera's 16:9 mode (ILCE-7SM2, DSLR-A580) now get the 16:9 crop of their camera JPEG instead of the whole 3:2 frame with padding columns, and the DSC-R1's encrypted SR2 opens from its preview instead of decoding to noise, issue #535; Canon PowerShot and EOS M CR2s whose `ColorData` is stored as bytes opened green until the bytes were read as 16-bit words, 25 files from 25 bodies checked). Compressed RAF sensor arrays verified on 13 Fujifilm bodies (`docs/raf-compression.md`). Grow the CC0 corpus per model and test each sample decodes with plausible colour. Nikon CropArea and untagged-preview colour-space regression tests; private Z 8 crop verified. | | LR-IMP-CULL-AT-IMPORT | Culling analysis at import | P2 | 🟡 | `cmd:photo.analyze` | run Assisted Culling on the imported photos (they're selected after an import); not automatic | | LR-IMP-MOVE | Move on import [Classic] | P1 | ✅ | `cmd:library.import` (`mode` move), `crates/engine/src/import_move.rs`, `crates/engine/src/tests_import_move.rs`, `crates/ui-egui/src/import.rs` | Transfer ▸ Move with Copy's destination, folders (day / month / one folder / custom template), rename template and example destination; XMP sidecars (both namings) move along; each source is removed only after its destination is written (hard link on the same volume, else copied, synced and compared byte for byte) and its catalog record is saved; failed, duplicate, unchecked files keep their sources, taken names get -1, -2…, never overwritten; files already in the destination/library are added in place; sources that can't be removed (read-only card) are kept and reported (`kept`). Undo removes the photos from the library but leaves the moved files at the destination. No Copy as DNG while moving | | LR-IMP-DNG-CONVERT | Convert to DNG on import [Classic] | P2 | ✅ | `cmd:library.import` (`dng`), `crates/ui-egui/src/import.rs` | copy imports: Raw files ▸ Copy as DNG (lossless; the card is untouched); the raw copy is removed only once its DNG is verified and on disk (issue #106) | diff --git a/xtask/src/main.rs b/xtask/src/main.rs index cfdec92a..f81464ad 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -356,6 +356,19 @@ const RAW_SAMPLES: &[(&str, &str, &str)] = &[ "https://raw.pixls.us/data/Sony/ILCE-7RM2/12-bit-uncompressed.ARW", "71e0888396ef52c7e6a990b4e72ebb4d8413a1fc1c35bada449870539cef6e39", ), + // pre-2017 bodies in the camera's 16:9 mode (#535): the ILCE-7SM2 records it in FullImageSize, the DSLR-A580 only + // in the Exif image size; and the DSC-R1's SR2, whose raw data is encrypted (opens from its preview) + ( + "arw-sony-a7sm2-16x9.arw", + "https://raw.pixls.us/data/Sony/ILCE-7SM2/DSC01005.ARW", + "46044fb6a9c805f2b4915cd4970316b4d04b0566bcf5287afaad3ef648d7a3db", + ), + ( + "arw-sony-a580-16x9.arw", + "https://raw.pixls.us/data/Sony/DSLR-A580/RAW_SONY_A580.ARW", + "5b0924d39151239dce19e92e08318f4f62a5a8ac276bd7180ec8463d2cfee709", + ), + ("arw-sony-r1-sr2.sr2", "https://raw.pixls.us/data/Sony/DSC-R1/_DSC1477.SR2", "921c5f2513dd1671a9089e73fc778fc3573bc4cb70a3a555d0414661d0e62274"), // CR2 colour-filter layouts differ by model (issue #85): CR2CFAPattern 3 (GBRG) and 1 (RGGB) samples ( "cr2-canon-40d.cr2",