Skip to content

Commit a3c09d1

Browse files
committed
chore: add example
1 parent 8d75278 commit a3c09d1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
//!
33
//! `fuji` is a library to read Fujifilm Recipes & Exif Metadata from a JPEG or RAF file using
44
//! [exiftool](https://exiftool.org/).
5+
//!
6+
//! ## Example
7+
//!
8+
//! ```
9+
//! use fuji::exiftool::spawn;
10+
//! use fuji::recipe::read;
11+
//!
12+
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
13+
//! // Read metadata from a Fujifilm image
14+
//! let path = std::path::Path::new("tests/img/DSCF5230.JPG");
15+
//! let metadata = spawn::read_metadata(&path, None)?;
16+
//!
17+
//! // Parse the Fujifilm recipe from the metadata
18+
//! let recipe = read::from_exif(&metadata)?;
19+
//!
20+
//! // Recipe will contain details like FilmSimulation, WhiteBalance, etc.
21+
//! if let Some(details) = recipe {
22+
//! println!("Film Simulation: {:?}", details.film_simulation);
23+
//! println!("White Balance: {:?}", details.settings);
24+
//! }
25+
//! # Ok(())
26+
//! # }
527
628
pub mod exif;
729
pub mod exiftool;

0 commit comments

Comments
 (0)