From c1f0c23b47970c28ed286c104dad51d40db0a9bf Mon Sep 17 00:00:00 2001 From: Enric Pou Date: Thu, 22 May 2025 08:57:41 +0200 Subject: [PATCH] Mypy fix: Cast v.numerator to float --- src/PIL/TiffImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 0147f79f2..9bdf7c015 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -691,7 +691,7 @@ class ImageFileDirectory_v2(_IFDv2Base): if all(isinstance(v, IFDRational) for v in values): for v in values: assert isinstance(v, IFDRational) - if v < 0 or (math.isnan(v) and v.numerator < 0): + if v < 0 or (math.isnan(v) and float(v.numerator) < 0): self.tagtype[tag] = TiffTags.SIGNED_RATIONAL break else: