mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
Fix IFDRational with a zero denominator
This commit is contained in:
parent
5ff20273d9
commit
4611a24661
|
@ -294,7 +294,7 @@ def _accept(prefix: bytes) -> bool:
|
|||
def _limit_rational(
|
||||
val: float | Fraction | IFDRational, max_val: int
|
||||
) -> tuple[IntegralLike, IntegralLike]:
|
||||
inv = abs(float(val)) > 1
|
||||
inv = abs(val) > 1
|
||||
n_d = IFDRational(1 / val if inv else val).limit_rational(max_val)
|
||||
return n_d[::-1] if inv else n_d
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user