diff options
author | Hubert Figuière <hub@figuiere.net> | 2023-07-27 21:48:03 -0400 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2023-07-27 21:48:35 -0400 |
commit | 8e15fa42fe5ede94e11f2335b2fcd8c945129338 (patch) | |
tree | 63213ac27b26e3906c68fc1bdf87bc8d4778f582 | |
parent | 16f60cd09d3d2b243ffcfec95d94cc109a26b530 (diff) |
metadata: store the IFD type
-rw-r--r-- | src/metadata.rs | 2 | ||||
-rw-r--r-- | src/tiff/iterator.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/metadata.rs b/src/metadata.rs index e749f88..e852558 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -42,7 +42,7 @@ pub enum Value { } /// Metadata type. -pub type Metadata = (Key, Value); +pub type Metadata = (Key, Value, i16); impl Value { pub fn count(&self) -> usize { diff --git a/src/tiff/iterator.rs b/src/tiff/iterator.rs index a66183e..31a0667 100644 --- a/src/tiff/iterator.rs +++ b/src/tiff/iterator.rs @@ -24,7 +24,7 @@ use std::collections::btree_map; use crate::container::Endian; -use crate::metadata::Value as MetadataValue; +use crate::metadata::{Metadata, Value as MetadataValue}; use crate::utils; use super::{exif, Dir, Entry, IfdType}; @@ -50,7 +50,7 @@ impl<'a> Iterator<'a> { } impl<'a> std::iter::Iterator for Iterator<'a> { - type Item = (String, MetadataValue); + type Item = Metadata; fn next(&mut self) -> Option<Self::Item> { let ns = match self.dir.type_ { @@ -64,7 +64,7 @@ impl<'a> std::iter::Iterator for Iterator<'a> { let tag_name = self.dir.tag_names.get(e.0).unwrap_or(&""); let value = from_entry(e.1, self.dir.endian); - (format!("{ns}.{tag_name}"), value) + (format!("{ns}.{tag_name}"), value, e.1.type_) }) } } |