mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
swap conditions
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
0d841aab9a
commit
f044d53fd1
|
@ -115,7 +115,7 @@ class PpmImageFile(ImageFile.ImageFile):
|
|||
for ix in range(3):
|
||||
if mode == "F" and ix == 2:
|
||||
scale = float(self._read_token())
|
||||
if not math.isfinite(scale) or scale == 0.0:
|
||||
if scale == 0.0 or not math.isfinite(scale):
|
||||
msg = "scale must be finite and non-zero"
|
||||
raise ValueError(msg)
|
||||
rawmode = "F;32F" if scale < 0 else "F;32BF"
|
||||
|
|
Loading…
Reference in New Issue
Block a user