Change EXIF Applicability's None to passthrough

This allows it to address the case of copying all EXIF data into a
separate file. And as soon as our decoder can handle files without any
image data (missing any stripoffsets, etc.) in ways that do not return
errors we can hopefully do the opposite and merge the data again.
This commit is contained in:
A. Molzer committed 2026-01-15 20:21:54 +01:00
1 parent f057b5f47d
commit 74191f92bb
2 files changed
+10 -8

No files matched your search

+8
View File
@@ -777,7 +777,15 @@ impl Default for EncodeMetadataOptions<'_> {
#[non_exhaustive] #[non_exhaustive]
#[derive(Clone, Copy, Default)] #[derive(Clone, Copy, Default)]
pub struct EncodeMetadataApplicability { pub struct EncodeMetadataApplicability {
/// The photometric interpretation of the image data.
///
/// If `None` then metadata tags are not filtered, otherwise only tags applicable to the given
/// photometric interpretation are recorded.
pub photometric: Option<PhotometricInterpretation>, pub photometric: Option<PhotometricInterpretation>,
/// The planar configuration of the image data.
///
/// If `None` then metadata tags are not filtered, otherwise only tags applicable to the given
/// configuration are recorded.
pub planar: Option<PlanarConfiguration>, pub planar: Option<PlanarConfiguration>,
} }
+2 -8
View File
@@ -169,16 +169,10 @@ impl TagFilter {
Level::Photometric(photometric) => { Level::Photometric(photometric) => {
match (photometric, target.planar, target.photometric) { match (photometric, target.planar, target.photometric) {
(Photometric::All, _, _) => Choice::Ok, (Photometric::All, _, _) => Choice::Ok,
(Photometric::Planar, Some(PlanarConfiguration::Planar), _) => Choice::Ok, (Photometric::Planar, Some(PlanarConfiguration::Planar) | None, _) => {
(Photometric::Planar, None, _)
if matches!(self.filter_level, FilterLevel::All) =>
{
Choice::Ok Choice::Ok
} }
(Photometric::YCbCr, _, Some(PhotometricInterpretation::YCbCr)) => Choice::Ok, (Photometric::YCbCr, _, Some(PhotometricInterpretation::YCbCr) | None) => {
(Photometric::YCbCr, _, None)
if matches!(self.filter_level, FilterLevel::All) =>
{
Choice::Ok Choice::Ok
} }
_ => Choice::Discard, _ => Choice::Discard,