#exif #metadata #image #photo #file-metadata

revolt_little_exif

(fork which includes support for passing filetype directly) This little library implements simple functionality for basic reading and writing of EXIF (related) metadata for PNG and JP(E)G image files (other file types - e.g. TIFF or HEIC - are planned for the future), with the advantage of being solely written in Rust & not relying on any 3rd party (C-)library for accessing the data (there are dependencies e.g. for calculating checksums or (de)compressing - however, they are also written in Rust).

1 unstable release

0.4.0 Sep 6, 2024

#453 in Images

Download history 107/week @ 2024-09-01 10/week @ 2024-09-08 26/week @ 2024-09-15 12/week @ 2024-09-22 16/week @ 2024-09-29

89 downloads per month

MIT/Apache

125KB
3K SLoC

little_exif

A little library for reading and writing EXIF data in pure Rust.

version-badge  license-badge 

Example

use little_exif::metadata::Metadata;
use little_exif::exif_tag::ExifTag;

let image_path = std::path::Path::new("image.png");
let mut metadata = Metadata::new_from_path(&image_path);

metadata.set_tag(
	ExifTag::ImageDescription("Hello World!".to_string())
);

metadata.write_to_file(&image_path);

License

Licensed under either

at your option.


lib.rs:

little_exif

A small crate for reading and writing (at least some) EXIF data written entirely in Rust. Currently supports only .png and .jp(e)g files and a few dozen tags in IFD0 and ExifIFD.

Interaction is done via the Metadata struct and the ExifTag enum.

Usage

Write EXIF data

use little_exif::metadata::Metadata;
use little_exif::exif_tag::ExifTag;

let mut metadata = Metadata::new();
metadata.set_tag(
    ExifTag::ImageDescription("Hello World!".to_string())
);
metadata.write_to_file(std::path::Path::new("image.png"));

Dependencies

~275KB