mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-12 16:55:47 +03:00
Call startswith/endswith once with a tuple
This commit is contained in:
parent
e4cac21044
commit
a2b13cc02a
|
@ -123,8 +123,7 @@ def read_png_or_jpeg2000(
|
|||
Image._decompression_bomb_check(im.size)
|
||||
return {"RGBA": im}
|
||||
elif (
|
||||
sig.startswith(b"\xff\x4f\xff\x51")
|
||||
or sig.startswith(b"\x0d\x0a\x87\x0a")
|
||||
sig.startswith((b"\xff\x4f\xff\x51", b"\x0d\x0a\x87\x0a"))
|
||||
or sig == b"\x00\x00\x00\x0cjP \x0d\x0a\x87\x0a"
|
||||
):
|
||||
if not enable_jpeg2k:
|
||||
|
|
|
@ -1584,7 +1584,7 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
# byte order.
|
||||
elif rawmode == "I;16":
|
||||
rawmode = "I;16N"
|
||||
elif rawmode.endswith(";16B") or rawmode.endswith(";16L"):
|
||||
elif rawmode.endswith((";16B", ";16L")):
|
||||
rawmode = rawmode[:-1] + "N"
|
||||
|
||||
# Offset in the tile tuple is 0, we go from 0,0 to
|
||||
|
|
Loading…
Reference in New Issue
Block a user