Skip to main content

Crate exiftool_rs

Crate exiftool_rs 

Source
Expand description

§exiftool-rs

A pure Rust reimplementation of ExifTool for reading, writing, and editing metadata in image, audio, video, and document files.

195/195 test files (100%) produce identical tag names and values as Perl ExifTool 13.59 — over 10,000 tags across the corpus. The comparison runs live in CI and is published as a tag-by-tag parity report.

§Quick Start

use exiftool_rs::ExifTool;

let et = ExifTool::new();
let tags = et.extract_info("photo.jpg").unwrap();
for tag in &tags {
    println!("{}: {}", tag.name, tag.print_value);
}

§One-liner

let info = exiftool_rs::image_info("photo.jpg").unwrap();
println!("Camera: {}", info.get("Model").unwrap_or(&String::new()));

§Writing Tags

use exiftool_rs::ExifTool;

let mut et = ExifTool::new();
et.set_new_value("Artist", Some("John Doe"));
et.write_info("photo.jpg", "photo_out.jpg").unwrap();

§Supported Formats (93 readers, 15 writers)

Images: JPEG, TIFF, PNG, WebP, PSD, BMP, GIF, HEIF/AVIF, ICO, XCF, BPG, MIFF, PGF, PPM, PCX, PICT, JXR, FLIF, MNG, Radiance HDR, OpenEXR, PSP, InDesign

Raw: CR2, CR3, CRW, CRM, NEF, DNG, ARW, ORF, RAF, RW2, PEF, SR2, X3F, IIQ, 3FR, ERF, MRW, SRW, Rawzor, KyoceraRaw

Video: MP4/MOV, AVI, MKV, MTS, MPEG, WTV, DV, FLV, SWF, MXF, ASF/WMV, Real

Audio: MP3, FLAC, WAV, OGG, AAC, AIFF, APE, MPC, WavPack, DSF, Audible, Opus

Documents: PDF, RTF, HTML, PostScript, DjVu, OpenDocument, TNEF, Font (TTF/OTF/WOFF)

Scientific: DICOM, MRC, FITS, XISF, DPX, LIF (Leica)

Archives: ZIP, 7Z, RAR, GZIP, ISO, Torrent

Other: EXE/ELF/Mach-O, LNK, VCard, ICS, JSON, PLIST, MIE, Lytro LFP, FLIR FPF, CaptureOne EIP, Palm PDB, PCAP

Timed metadata (-ee): freeGPS (dashcams), GoPro GPMF, Google CAMM, NMEA, Kenwood, DJI, Insta360

MakerNotes: Canon, Nikon, Sony, Pentax, Olympus, Panasonic, Fujifilm, Samsung, Sigma, Casio, Ricoh, Minolta, Apple, Google, FLIR, GE, GoPro

§Community & support

Questions, bugs, beta testing — join the Discord: https://discord.gg/T37DYHmt2j

Re-exports§

pub use crate::error::Error;
pub use crate::error::Result;
pub use crate::exiftool::ExifTool;
pub use crate::exiftool::ImageInfo;
pub use crate::exiftool::Options;
pub use crate::file_type::FileType;
pub use crate::tag::Tag;
pub use crate::tag::TagGroup;
pub use crate::tag::TagId;
pub use crate::value::Value;

Modules§

composite
Composite (derived/calculated) tags.
config
ExifTool configuration file parser (.ExifTool_config).
encoding
Text encoding utilities for metadata decoding.
error
exiftool
Core ExifTool struct and public API.
file_type
formats
geolocation
Geolocation reverse geocoding using ExifTool’s Geolocation.dat.
geotag
GPX file parsing and GPS geotagging support.
i18n
Internationalization support for tag descriptions and PrintConv values.
md5
Minimal MD5 implementation (RFC 1321) for CurrentIPTCDigest.
metadata
tag
tags
value
writer

Constants§

EXIFTOOL_VERSION
The Perl ExifTool release this crate mirrors — the single source of truth for “which ExifTool are we iso with”. Bump it when the ported tables / print conversions are regenerated against a newer ExifTool. The parity binary pins this version by default when diffing live against Perl.
VERSION
Library version.

Functions§

get_file_type
Detect the file type of the given file.
image_info
Convenience function: extract metadata from a file in one call.