From 4a7eb6b338b7a84340ca99ac9f2f0363ef2f7a7a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 10 Oct 2026 03:57:57 -0400 Subject: [PATCH] LR-IMP-FORMATS: #573's centred crop and #498's DefaultCrop helper side by side (merge put the flag on the wrong function) Co-Authored-By: Claude Opus 5.5 --- crates/raw/src/vendor/arw.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/raw/src/vendor/arw.rs b/crates/raw/src/vendor/arw.rs index b9a05a49..d80c67f8 100644 --- a/crates/raw/src/vendor/arw.rs +++ b/crates/raw/src/vendor/arw.rs @@ -486,11 +486,7 @@ fn word16_order(strip: &[u8], bits: u32, file: lightcraft_tiff::ByteOrder) -> li } /// The raw IFD's DNG-style `DefaultCropOrigin` / `DefaultCropSize`, clipped to the `w × h` frame. -/// -/// `centred` places that recorded-size window in the middle of the frame (on even offsets, keeping the CFA phase) -/// instead of at the left: the packed 12-bit frame (DSLR-A900) has no padding at either edge, and its camera JPEG -/// is centred on the frame. -fn dng_default_crop(raw: &Ifd, w: usize, h: usize, centred: bool) -> Option { +fn dng_default_crop(raw: &Ifd, w: usize, h: usize) -> Option { 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 && *ch > 0 @@ -502,7 +498,11 @@ fn dng_default_crop(raw: &Ifd, w: usize, h: usize, centred: bool) -> Option, exif_size: Option<(u64, u64)>, w: usize, h: usize) -> Rect { +/// +/// `centred` places that recorded-size window in the middle of the frame (on even offsets, keeping the CFA phase) +/// instead of at the left: the packed 12-bit frame (DSLR-A900) has no padding at either edge, and its camera JPEG +/// is centred on the frame. +fn default_crop(raw: &Ifd, mn: Option<&makernote::MakerNote>, exif_size: Option<(u64, u64)>, w: usize, h: usize, centred: bool) -> Rect { let full = Rect::new(0, 0, w, h); if let Some(crop) = dng_default_crop(raw, w, h) { return crop;