felixc / rexiv2

Rust library for read/write access to media-file metadata (Exif, XMP, and IPTC)
GNU General Public License v3.0
79 stars 17 forks source link

Metadata returned as Ratios should not be in reduced form #64

Closed felixc closed 1 year ago

felixc commented 1 year ago

Methods that return a Ratio, such as get_tag_rational and get_exposure_time, currently mangle the data by returning the rational in reduced (simplified) form. That is to say, an original value like 16/8 will be returned as 2/1.

The fix should be as simple as switching from Ratio::new() to Ratio::new_raw(), along with checking for a 0 denominator.