Skip to content

Commit

Permalink
Fix IFDRational with a zero denominator
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 16, 2024
1 parent 5ff2027 commit 4611a24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4611a24

Please sign in to comment.