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

Do not reduce/simplify rational values (i.e. 16/10 is not 8/5) #66

Closed felixc closed 1 year ago

felixc commented 1 year ago

num_rational::Ratio::new() by default simplifies/reduces rational values to their standard form. This means apertures, exposures, and the like would get mangled. We can avoid this by using new_raw() instead and checking for 0 denominators ourselves.

Fixes #64

codecov[bot] commented 1 year ago

Codecov Report

Base: 68.63% // Head: 68.59% // Decreases project coverage by -0.04% :warning:

Coverage data is based on head (0db278f) compared to base (2718765). Patch coverage: 75.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #66 +/- ## ========================================== - Coverage 68.63% 68.59% -0.04% ========================================== Files 1 1 Lines 966 968 +2 ========================================== + Hits 663 664 +1 - Misses 303 304 +1 ``` | [Impacted Files](https://codecov.io/gh/felixc/rexiv2/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Felix+Crux) | Coverage Δ | | |---|---|---| | [src/lib.rs](https://codecov.io/gh/felixc/rexiv2/pull/66?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Felix+Crux#diff-c3JjL2xpYi5ycw==) | `68.59% <75.00%> (-0.04%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Felix+Crux). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Felix+Crux)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.