Exposes Exif data as an Option<Vec<u8>> that can be parsed by client code e.g. using kamadak-exif (or simply to pass it on when saving the file again):
let path = Path::new("tests")
.join("reftest")
.join("images")
.join("ycck.jpg");
let mut decoder = jpeg::Decoder::new(File::open(&path).unwrap());
decoder.decode().unwrap();
let exif_data = decoder.exif_data().unwrap();
let exif_reader = exif::Reader::new();
let exif = exif_reader.read_raw(exif_data).unwrap();
for field in exif.fields() {
println!("{}", field.display_value());
}
Not 100% sure about the exif_data() method. Since Exif might contain up to 64kb a copy might be a bit much.
Perhaps:
I must have missed the force pushed commit addressing the review comment. @fseegraeber Pinging a maintainer when a PR is in limbo is absolutely encouraged :slightly_smiling_face:
Implements #42.
Also a first step towards image#1045.
Exposes Exif data as an
Option<Vec<u8>>
that can be parsed by client code e.g. usingkamadak-exif
(or simply to pass it on when saving the file again):Not 100% sure about the
exif_data()
method. Since Exif might contain up to 64kb a copy might be a bit much. Perhaps:or
I guess exif data might be inspected multiple times e.g. to determine orientation?