#exif #metadata #image #photo

little_exif

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).

2 unstable releases

0.3.2 Apr 14, 2024
0.3.1 Feb 26, 2024
0.3.0 Jan 15, 2024
0.2.1 Dec 27, 2023
0.1.1 Oct 8, 2022

#142 in Images

Download history 3/week @ 2024-02-15 121/week @ 2024-02-22 41/week @ 2024-02-29 39/week @ 2024-03-07 172/week @ 2024-03-14 58/week @ 2024-03-21 42/week @ 2024-03-28 33/week @ 2024-04-04 170/week @ 2024-04-11 32/week @ 2024-04-18 3/week @ 2024-04-25 4/week @ 2024-05-02

214 downloads per month

MIT/Apache

115KB
2.5K 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