pub struct ExifTool { /* private fields */ }Implementations§
Source§impl ExifTool
impl ExifTool
Sourcepub fn with_options(options: Options) -> Self
pub fn with_options(options: Options) -> Self
Create a new ExifTool instance with custom options.
Sourcepub fn options_mut(&mut self) -> &mut Options
pub fn options_mut(&mut self) -> &mut Options
Get a mutable reference to the options.
Sourcepub fn set_new_value(&mut self, tag: &str, value: Option<&str>)
pub fn set_new_value(&mut self, tag: &str, value: Option<&str>)
Queue a new tag value for writing.
Call this one or more times, then call write_info() to apply changes.
§Arguments
tag- Tag name, optionally prefixed with group (e.g., “Artist”, “XMP:Title”, “EXIF:Copyright”)value- New value, or None to delete the tag
§Example
use exiftool_rs::ExifTool;
let mut et = ExifTool::new();
et.set_new_value("Artist", Some("John Doe"));
et.set_new_value("Copyright", Some("2024 John Doe"));
et.set_new_value("XMP:Title", Some("My Photo"));
et.write_info("photo.jpg", "photo_out.jpg").unwrap();Sourcepub fn clear_new_values(&mut self)
pub fn clear_new_values(&mut self)
Clear all queued new values.
Sourcepub fn set_new_values_from_file<P: AsRef<Path>>(
&mut self,
src_path: P,
tags_to_copy: Option<&[&str]>,
) -> Result<u32>
pub fn set_new_values_from_file<P: AsRef<Path>>( &mut self, src_path: P, tags_to_copy: Option<&[&str]>, ) -> Result<u32>
Copy tags from a source file, queuing them as new values.
Reads all tags from src_path and queues them for writing.
Optionally filter by tag names.
Sourcepub fn set_file_name_from_tag<P: AsRef<Path>>(
&self,
path: P,
tag_name: &str,
template: &str,
) -> Result<String>
pub fn set_file_name_from_tag<P: AsRef<Path>>( &self, path: P, tag_name: &str, template: &str, ) -> Result<String>
Set a file’s name based on a tag value.
Sourcepub fn write_info<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
src_path: P,
dst_path: Q,
) -> Result<u32>
pub fn write_info<P: AsRef<Path>, Q: AsRef<Path>>( &self, src_path: P, dst_path: Q, ) -> Result<u32>
Write queued changes to a file.
If dst_path is the same as src_path, the file is modified in-place
(via a temporary file).
Sourcepub fn image_info<P: AsRef<Path>>(&self, path: P) -> Result<ImageInfo>
pub fn image_info<P: AsRef<Path>>(&self, path: P) -> Result<ImageInfo>
Extract metadata from a file and return a simple name→value map.
This is the high-level one-shot API, equivalent to ExifTool’s ImageInfo().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExifTool
impl RefUnwindSafe for ExifTool
impl Send for ExifTool
impl Sync for ExifTool
impl Unpin for ExifTool
impl UnsafeUnpin for ExifTool
impl UnwindSafe for ExifTool
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
Mutably borrows from an owned value. Read more