pub struct ImageMetadata {Show 14 fields
pub camera: CameraInfo,
pub exif: ExifInfo,
pub datetime: DateTimeInfo,
pub gps: GpsInfo,
pub dng_color: DngColorInfo,
pub dng_calibration: DngCalibrationInfo,
pub dng_profile: DngProfileInfo,
pub image: ImageInfo,
pub xmp: Option<Vec<u8>>,
pub icc_profile: Option<Vec<u8>>,
pub exif_raw: Option<Vec<u8>>,
pub makernote_raw: Option<Vec<u8>>,
pub iptc_raw: Option<Vec<u8>>,
pub extra: Vec<MetadataEntry>,
}Expand description
Complete image metadata — unified superset of all supported formats.
This struct is designed for extension. Common metadata has dedicated typed
fields (camera, exif, …); anything the
library does not model is preserved losslessly via the raw-blob fields
(exif_raw, xmp, …) and the typed generic
table extra, so new formats never force a schema change.
Fields§
§camera: CameraInfoCamera identification
exif: ExifInfoEXIF exposure settings
datetime: DateTimeInfoDate/time information
gps: GpsInfoGPS location data
dng_color: DngColorInfoDNG color science
dng_calibration: DngCalibrationInfoDNG calibration/noise
dng_profile: DngProfileInfoDNG profile data
image: ImageInfoImage-level metadata
xmp: Option<Vec<u8>>Raw XMP (XML) metadata bytes, if present in source image
icc_profile: Option<Vec<u8>>Raw embedded ICC color profile bytes, if present
exif_raw: Option<Vec<u8>>Full raw EXIF block (TIFF byte stream) exactly as embedded, if present
makernote_raw: Option<Vec<u8>>Raw manufacturer MakerNote blob, uninterpreted, if present
iptc_raw: Option<Vec<u8>>Raw IPTC IIM block, if present
extra: Vec<MetadataEntry>Typed generic tag table.
Holds metadata tags as a complete typed mirror of the source — including tags also surfaced as dedicated fields above, and anything the library does not model. Guarantees no metadata is silently dropped.
Stored as a Vec (not a map) so it serializes cleanly in every serde
format and preserves source ordering. Use get /
insert for map-like access.
Implementations§
Source§impl ImageMetadata
impl ImageMetadata
Sourcepub fn get(
&self,
namespace: MetadataNamespace,
tag: &str,
) -> Option<&MetadataValue>
pub fn get( &self, namespace: MetadataNamespace, tag: &str, ) -> Option<&MetadataValue>
Look up a generic tag in extra.
Returns the first entry matching namespace and tag.
Sourcepub fn insert(&mut self, key: MetadataKey, value: MetadataValue)
pub fn insert(&mut self, key: MetadataKey, value: MetadataValue)
Insert or overwrite a generic tag in extra.
If an entry with the same key already exists, its value is replaced; otherwise the entry is appended.
Trait Implementations§
Source§impl Clone for ImageMetadata
impl Clone for ImageMetadata
Source§fn clone(&self) -> ImageMetadata
fn clone(&self) -> ImageMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImageMetadata
impl Debug for ImageMetadata
Source§impl Default for ImageMetadata
impl Default for ImageMetadata
Source§fn default() -> ImageMetadata
fn default() -> ImageMetadata
Source§impl<'de> Deserialize<'de> for ImageMetadata
impl<'de> Deserialize<'de> for ImageMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ImageMetadata
impl PartialEq for ImageMetadata
Source§fn eq(&self, other: &ImageMetadata) -> bool
fn eq(&self, other: &ImageMetadata) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ImageMetadata
impl Serialize for ImageMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ImageMetadata
Auto Trait Implementations§
impl Freeze for ImageMetadata
impl RefUnwindSafe for ImageMetadata
impl Send for ImageMetadata
impl Sync for ImageMetadata
impl Unpin for ImageMetadata
impl UnsafeUnpin for ImageMetadata
impl UnwindSafe for ImageMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more