Use endswith

This commit is contained in:
Andrew Murray 2024-12-30 19:45:46 +11:00
parent 167ed55d8b
commit 7cee64ad1b

View File

@ -1573,10 +1573,8 @@ class TiffImageFile(ImageFile.ImageFile):
# byte order.
elif rawmode == "I;16":
rawmode = "I;16N"
elif ";16B" in rawmode:
rawmode = rawmode.replace(";16B", ";16N")
elif ";16L" in rawmode:
rawmode = rawmode.replace(";16L", ";16N")
elif rawmode.endswith(";16B") or rawmode.endswith(";16L"):
rawmode = rawmode[:-1] + "N"
# Offset in the tile tuple is 0, we go from 0,0 to
# w,h, and we only do this once -- eds