The Value enum is the primary type used to represent the different data types found in TIFF/Exif fields. It can hold various formats including integers (Byte, Short, Long, SByte, SShort, SLong), rationals (Rational, SRational), floating-point numbers (Float, Double), ASCII strings, and Undefined byte slices.
To display a value in a format specific to its Exif tag (e.g., converting a Short to a human-readable string like "inch" for a resolution unit), use the display_as method. Note that display_as provides the raw value; if you need the value with its associated unit, use Field::display_value instead.
use exif::{Value, Tag};
// Example: Displaying a value according to its tag
let val = Value::Short(vec![2]);
assert_eq!(val.display_as(Tag::ResolutionUnit).to_string(), "inch");
// Example: Displaying ExifVersion
let val = Value::Undefined(b"0231".to_vec(), 0);
assert_eq!(val.display_as(Tag::ExifVersion).to_string(), "2.31");