Skip to content

Commit 4611a24

Browse files
committed
Fix IFDRational with a zero denominator
1 parent 5ff2027 commit 4611a24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PIL/TiffImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _accept(prefix: bytes) -> bool:
294294
def _limit_rational(
295295
val: float | Fraction | IFDRational, max_val: int
296296
) -> tuple[IntegralLike, IntegralLike]:
297-
inv = abs(float(val)) > 1
297+
inv = abs(val) > 1
298298
n_d = IFDRational(1 / val if inv else val).limit_rational(max_val)
299299
return n_d[::-1] if inv else n_d
300300

0 commit comments

Comments
 (0)