We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 851cd0e commit db7a22aCopy full SHA for db7a22a
README.md
@@ -9,12 +9,22 @@ Read IPTC tags from JPEG files, in pure Rust.
9
10
```rs
11
use iptc::IPTC;
12
+use iptc::IPTCTag;
13
+use std::error::Error;
14
use std::path::Path;
15
-let image_path = Path::new("image.png");
-let mut tags = IPTC::read_from_path(&image_path);
16
+fn main() -> Result<(), Box<dyn Error>> {
17
+ let image_path = Path::new("tests/smiley.jpg");
18
-let city = tags.get(IPTCTag::City)
19
+ let iptc = IPTC::read_from_path(&image_path)?;
20
-assert_eq!(city, "London");
21
+ // See all the tags in the image
22
+ println!("IPTC: {:?}", iptc.get_all());
23
+
24
+ // Get a specific tag
25
+ let keywords = iptc.get(IPTCTag::Keywords);
26
+ println!("keywords: {}", keywords);
27
28
+ Ok(())
29
+}
30
```
0 commit comments