#iptc #tags #error #path #image-metadata #iptc-tag #iptc-metadata

iptc

Read IPTC tags from JPEG files in pure Rust, with partial support for Tiff files

2 unstable releases

Uses new Rust 2024

0.1.0 Mar 29, 2025
0.0.1 Mar 23, 2025

#7 in #image-metadata

Download history 103/week @ 2025-03-22 136/week @ 2025-03-29 9/week @ 2025-04-05

248 downloads per month

MIT license

24KB
495 lines

Library to read IPTC tags from JPEG files, in pure Rust.

Example

use iptc::IPTC;
use iptc::IPTCTag;
use std::error::Error;
use std::path::Path;
fn main() -> Result<(), Box<dyn Error>> {
    let image_path = Path::new("tests/smiley.jpg");

    let iptc = IPTC::read_from_path(&image_path)?;

    // See all the tags in the image
    println!("IPTC: {:?}", iptc.get_all());

    // Get a specific tag
    let keywords = iptc.get(IPTCTag::Keywords);
    println!("keywords: {}", keywords);

    Ok(())
}

IPTC

Crates.io CI Build

Read IPTC tags from JPEG files in pure Rust, with partial support for Tiff files.

Example

use iptc::IPTC;
use iptc::IPTCTag;
use std::error::Error;
use std::path::Path;

fn main() -> Result<(), Box<dyn Error>> {
    let image_path = Path::new("tests/smiley.jpg");

    let iptc = IPTC::read_from_path(&image_path)?;

    // See all the tags in the image
    println!("IPTC: {:?}", iptc.get_all());

    // Get a specific tag
    let keywords = iptc.get(IPTCTag::Keywords);
    println!("keywords: {}", keywords);

    Ok(())
}

Dependencies

~6MB
~89K SLoC