oozcitak / exiflibrary

A .Net Standard library for editing Exif metadata
MIT License
131 stars 48 forks source link

Fraction32.IsInfinity and UFraction32.IsInifinity returns true for NaN fractions #104

Open Timie opened 2 years ago

Timie commented 2 years ago

UFraction32.IsInifity(new UFraction32(0,0)) and Fraction32.IsInifity(new Fraction32(0,0)) return both true even though the number is actually NaN. They should return false.

This is caused by the fact, that IsInfinity does not check whether numenator is not 0. See: https://github.com/oozcitak/exiflibrary/blob/1e0f8381cf9ed1788fd24d9a0ee1b8a7d198abdc/ExifLibrary/MathEx.cs#L203 and https://github.com/oozcitak/exiflibrary/blob/1e0f8381cf9ed1788fd24d9a0ee1b8a7d198abdc/ExifLibrary/MathEx.cs#L854