diff options
author | Hubert Figuière <hub@figuiere.net> | 2024-01-01 23:12:00 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2024-01-01 23:36:06 -0500 |
commit | 8fdb9106e3ad70a1a7881ab0c9acecc6455bbe96 (patch) | |
tree | ef9af6254581f2cf11056fe4022d8648c8a9bb67 | |
parent | f7701707e22ace1901f41e2fcc848d9681d8c100 (diff) |
orf: Set photometric interpretation for ORF files
- Also report the error better
Signed-off-by: Hubert Figuière <hub@figuiere.net>
-rw-r--r-- | src/olympus.rs | 3 | ||||
-rw-r--r-- | 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) + } } } |