Crates.io | fuji |
lib.rs | fuji |
version | |
source | src |
created_at | 2025-03-07 01:37:11.439459+00 |
updated_at | 2025-03-07 01:47:56.718307+00 |
description | A library to read Fujifilm Recipes & Exif Metadata from a JPEG or RAF file using exiftool. |
homepage | |
repository | |
max_upload_size | |
id | 1582142 |
Cargo.toml error: | TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Read Fujifilm Recipe Settings from EXIF using exiftool.
Note: This is not production ready and not recommended for everyday use until it can be shipped without the need for exiftool. However it works quite well with its limitations.
I tried using kamadak-exif but it does not read the EXIF data that I was interested in. There's also rexiv2 that seems to read the values needed for Fujifilm recipes, a later revision of this library will probably use this instead or as a different feature branch.
Exiftool on the other hand is quite powerful, it has a lot of support for and it works wonderfully. The only downside is the need of spawning a separate process to invoke it with Perl or run the executable in Windows.
This makes it awkward to ship, as it requires Perl to be installed on the system. As well as shipping the exiftool executable.
use fuji::exiftool::spawn;
use fuji::recipe::read;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Read metadata from a Fujifilm image
let path = std::path::Path::new("tests/img/DSCF5230.JPG");
let metadata = spawn::read_metadata(&path, None)?;
// Parse the Fujifilm recipe from the metadata
let recipe = read::from_exif(&metadata)?;
// Recipe will contain details like FilmSimulation, WhiteBalance, etc.
if let Some(details) = recipe {
println!("Film Simulation: {:?}", details.film_simulation);
println!("White Balance: {:?}", details.settings);
}
Ok(())
}
The library needs to have Perl available in the PATH Environment, or the Exiftool executable for Windows.
./scripts/unix/exiftool.sh
.\scripts\windows\exiftool.bat
Check the tests
directory for examples of usage.