Struct ExifData

Source
pub struct ExifData {
    pub source_file: String,
    pub exif_tool_version: String,
    pub tags: Vec<TagEntry>,
    pub legacy_tags: HashMap<String, TagValue>,
    pub errors: Vec<String>,
    pub missing_implementations: Option<Vec<String>>,
}
Expand description

Represents extracted EXIF data from an image

This matches ExifTool’s JSON output structure

Fields§

§source_file: String

Source file path

§exif_tool_version: String

Version of exif-oxide

§tags: Vec<TagEntry>

All extracted tags with both value and print representations

§legacy_tags: HashMap<String, TagValue>

Legacy field for backward compatibility - will be populated during serialization TODO: Remove this once all consumers are updated to use TagEntry

§errors: Vec<String>

Any errors encountered during processing

§missing_implementations: Option<Vec<String>>

Missing implementations (only included with –show-missing)

Implementations§

Source§

impl ExifData

Source

pub fn new(source_file: String, exif_tool_version: String) -> Self

Create a new ExifData with empty tags

Source

pub fn prepare_for_serialization( &mut self, numeric_tags: Option<&HashSet<String>>, )

Convert tags to legacy format for JSON serialization This populates legacy_tags from the TagEntry vector

Source

pub fn get_exif_ifd_tags(&self) -> Vec<&TagEntry>

Get all ExifIFD tags specifically ExifTool compatibility: access tags by Group1 location

Source

pub fn get_tags_by_group1(&self, group1_name: &str) -> Vec<&TagEntry>

Get all tags from a specific Group1 (subdirectory location) ExifTool: Group1-based filtering

§Examples
use exif_oxide::formats::extract_metadata;

let exif_data = extract_metadata(std::path::Path::new("image.jpg"), false).unwrap();

// Get all GPS tags
let gps_tags = exif_data.get_tags_by_group1("GPS");

// Get all ExifIFD tags
let exif_ifd_tags = exif_data.get_tags_by_group1("ExifIFD");
Source

pub fn get_tag_by_group( &self, group_name: &str, tag_name: &str, ) -> Option<&TagEntry>

ExifTool compatibility: get tag by group-qualified name Supports both Group0 and Group1 based access

§Examples
use exif_oxide::formats::extract_metadata;

let exif_data = extract_metadata(std::path::Path::new("image.jpg"), false).unwrap();

// Access by Group1 (subdirectory location)
let exposure_time = exif_data.get_tag_by_group("ExifIFD", "ExposureTime");

// Access by Group0 (format family)
let make = exif_data.get_tag_by_group("EXIF", "Make");
Source

pub fn get_tag_exiftool_style(&self, qualified_name: &str) -> Option<&TagEntry>

ExifTool-style group access: EXIF:ExposureTime vs ExifIFD:ExposureTime Parses qualified tag names in “Group:TagName” format

§Examples
use exif_oxide::formats::extract_metadata;

let exif_data = extract_metadata(std::path::Path::new("image.jpg"), false).unwrap();

let exposure_time = exif_data.get_tag_exiftool_style("ExifIFD:ExposureTime");
let gps_lat = exif_data.get_tag_exiftool_style("GPS:GPSLatitude");
Source

pub fn get_tag_by_name(&self, tag_name: &str) -> Option<&TagEntry>

Get tag by name (without group qualifier) Returns the first matching tag found

Trait Implementations§

Source§

impl Clone for ExifData

Source§

fn clone(&self) -> ExifData

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ExifData

Source§

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

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

impl<'de> Deserialize<'de> for ExifData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ExifData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,