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 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 ==.