Hi,
I did minimal EXIF support for DNG and CR2 RAW files. First, I did too mach changes in tiff.rs. I'm not sure I didn't break something.
Fixed: TiffIFD::find_ifds_with_tag returned same &TiffIFD twice
Added constants T_* for tag types
Added single functions get_***_entry_val into tiff.rs to convert raw bytes of TiffEntry to values. Functions are used both from tiff.rs and exif.rs
Fixed: getting of rational values worked wrong if integral values were too large (u32 -> f32 conversion loses data for large u32)
Support of FLOAT and DOUBLE tag types
The TiffEntry::get_u32 algorithm has been changed.
New module exif.rs. Contains trait for getting of Exif data + implementation that use get_***_entry_val functions to return values. Only tags listed in NativeExifInfo::new are stored in object and accessible to read
Removed ; from fetch_tag and fetch_ifd macro to get rid of compiler warnings
How to use:
let raw = rawloader::decode_file(file).unwrap();
if let Some(exif) = raw.exif {
let iso = exif.get_uint(rawloader::Tag::ISOSpeed).unwrap();
println!("ISO = {}", iso);
let exp_time = exif.get_rational(rawloader::Tag::ExposureTime).unwrap();
println!("Exposure time = {} seconds", exp_time);
for tag in exif.get_tags() {
if let Some(tag_str) = exif.to_string(tag) {
println!("{:?} = {}", tag, tag_str);
}
}
}
Hi, I did minimal EXIF support for DNG and CR2 RAW files. First, I did too mach changes in
tiff.rs
. I'm not sure I didn't break something.TiffIFD::find_ifds_with_tag
returned same&TiffIFD
twiceT_*
for tag typesget_***_entry_val
intotiff.rs
to convert raw bytes ofTiffEntry
to values. Functions are used both fromtiff.rs
andexif.rs
TiffEntry::get_u32
algorithm has been changed.exif.rs
. Contains trait for getting of Exif data + implementation that useget_***_entry_val
functions to return values. Only tags listed inNativeExifInfo::new
are stored in object and accessible to read;
fromfetch_tag
andfetch_ifd
macro to get rid of compiler warningsHow to use: