Skip to main content

ImageMetadata

Struct ImageMetadata 

Source
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: CameraInfo

Camera identification

§exif: ExifInfo

EXIF exposure settings

§datetime: DateTimeInfo

Date/time information

§gps: GpsInfo

GPS location data

§dng_color: DngColorInfo

DNG color science

§dng_calibration: DngCalibrationInfo

DNG calibration/noise

§dng_profile: DngProfileInfo

DNG profile data

§image: ImageInfo

Image-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

Source

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.

Source

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

Source§

fn clone(&self) -> ImageMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImageMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ImageMetadata

Source§

fn default() -> ImageMetadata

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ImageMetadata

Source§

fn eq(&self, other: &ImageMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ImageMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.