| Crates.io | exif-oxide |
| lib.rs | exif-oxide |
| version | 0.1.0 |
| created_at | 2025-07-17 02:47:48.034791+00 |
| updated_at | 2025-07-17 02:47:48.034791+00 |
| description | High-performance Rust implementation of ExifTool |
| homepage | |
| repository | https://github.com/photostructure/exif-oxide |
| max_upload_size | |
| id | 1757003 |
| size | 1,602,898 |
This directory contains the exif-oxide project, which ports ExifTool's metadata extraction functionality to Rust using a hybrid approach of code generation and manual implementations.
While ExifTool is the gold standard for metadata extraction, the Perl runtime that it relies on can grind against Windows and macOS security systems.
By translating to rust, applications using exif-oxide can be a single, "normal"
binary application that can "play nicely" with Defender and Gatekeeper, as well
as providing substantive performance gains over an approach that forks
exiftool as a child process.
geolocation functionalitySee ARCHITECTURE.md for architectural details.
For engineers starting on the project, see ENGINEER-GUIDE.md for practical guidance on understanding ExifTool and implementing features.
exiftool behavior-j (JSON output) is default behavior by the tool. There is no non-JSON output.This program and code is offered under a commercial and under the GNU Affero General Public License. See LICENSE for details.
This project includes a branch of exiftool as a submodule: use git clone --recursive. This branch has a number of documents to bolster comprehension of
ExifTool, which has a ton of surprising bits going on.
The production code paths are mostly produced via automatic code generation that reads from the ExifTool source directly.
git clone --recursive https://github.com/yourusername/exif-oxide$ exif-oxide --help
Extracts EXIF data from image files
Usage: exif-oxide [OPTIONS] [ARGS]...
Arguments:
[ARGS]... All remaining arguments (files and -TagName patterns)
Options:
-G, --groups Include group names in output
-n, --numeric Show numeric/raw values (no PrintConv)
-b, --binary Extract raw binary data (requires single tag and single file)
--api API mode: show both raw and formatted values with full type information
-h, --help Show help information
EXAMPLES:
exif-oxide photo.jpg # All tags as JSON
exif-oxide photo1.jpg photo2.jpg # Multiple files
exif-oxide -G photo.jpg # All tags with groups
exif-oxide -Make -Model photo.jpg # Only return Make and Model tag values
exif-oxide -b -ThumbnailImage photo.jpg > thumb.jpg # Save thumbnail
use exif_oxide::ExifReader;
use std::fs::File;
let mut reader = ExifReader::new();
let file = File::open("photo.jpg")?;
// Extract all mainstream metadata
let metadata = reader.read_metadata_stream(file, Default::default())?;
println!("Camera: {} {}", metadata.tags["Make"], metadata.tags["Model"]);
// Stream large binary data (thumbnails) without loading into memory
if let Some(thumbnail_ref) = metadata.get_binary_ref("ThumbnailImage") {
let file = File::open("photo.jpg")?;
let mut thumbnail_reader = reader.stream_binary_tag(file, thumbnail_ref)?;
let mut thumbnail_file = File::create("thumbnail.jpg")?;
std::io::copy(&mut thumbnail_reader, &mut thumbnail_file)?;
}
ExifTool tag names are preserved when possible, but tags with invalid Rust identifier characters are modified:
"NikonActiveD-Lighting""NikonActiveD_Lighting"Hyphens (and any other invalid characters) are converted to underscores to ensure that they are valid Rust identifiers, while mostly preserving semantic meaning.