From 8fdb9106e3ad70a1a7881ab0c9acecc6455bbe96 Mon Sep 17 00:00:00 2001 From: Hubert Figuière Date: Mon, 1 Jan 2024 23:12:00 -0500 Subject: orf: Set photometric interpretation for ORF files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Also report the error better Signed-off-by: Hubert Figuière --- src/olympus.rs | 3 ++- src/rawimage.rs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/olympus.rs b/src/olympus.rs index 2d3447c..f97a5d5 100644 --- a/src/olympus.rs +++ b/src/olympus.rs @@ -2,7 +2,7 @@ /* * libopenraw - olympus.rs * - * Copyright (C) 2022-2023 Hubert Figuière + * Copyright (C) 2022-2024 Hubert Figuière * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -402,6 +402,7 @@ impl RawFileImpl for OrfFile { } _ => data, }; + data.set_photometric_interpretation(exif::PhotometricInterpretation::CFA); data.set_bpc(12); data.set_active_area(Some(Rect { x: 0, diff --git a/src/rawimage.rs b/src/rawimage.rs index cf032e6..e1661d8 100644 --- a/src/rawimage.rs +++ b/src/rawimage.rs @@ -2,7 +2,7 @@ /* * libopenraw - rawimage.rs * - * Copyright (C) 2022-2023 Hubert Figuière + * Copyright (C) 2022-2024 Hubert Figuière * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -377,7 +377,10 @@ impl RawImage { match self.photom_int { exif::PhotometricInterpretation::CFA => render::demosaic::bimedian(&buffer, pattern), exif::PhotometricInterpretation::LinearRaw => render::grayscale::to_rgb(&buffer), - _ => Err(Error::InvalidFormat), + _ => { + log::error!("Invalid photometric interpretation {:?}", self.photom_int); + Err(Error::InvalidFormat) + } } } -- cgit v1.2.3