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
All extracted tags with both value and print representations
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
impl ExifData
Sourcepub fn new(source_file: String, exif_tool_version: String) -> Self
pub fn new(source_file: String, exif_tool_version: String) -> Self
Create a new ExifData with empty tags
Sourcepub fn prepare_for_serialization(
&mut self,
numeric_tags: Option<&HashSet<String>>,
)
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
Get all ExifIFD tags specifically ExifTool compatibility: access tags by Group1 location
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");
Sourcepub fn get_tag_by_group(
&self,
group_name: &str,
tag_name: &str,
) -> Option<&TagEntry>
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");
Sourcepub fn get_tag_exiftool_style(&self, qualified_name: &str) -> Option<&TagEntry>
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");
Sourcepub fn get_tag_by_name(&self, tag_name: &str) -> Option<&TagEntry>
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