mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-21 01:32:00 +03:00
conftest fixed
This commit is contained in:
parent
fdcb04ca81
commit
d73ce6aa55
|
@ -40,6 +40,11 @@ from typing import IO
|
|||
|
||||
from . import Image, ImageFile
|
||||
|
||||
branches = {
|
||||
"1": False,
|
||||
"2": False,
|
||||
}
|
||||
|
||||
class Format(IntEnum):
|
||||
JPEG = 0
|
||||
|
||||
|
@ -276,22 +281,20 @@ class BlpImageFile(ImageFile.ImageFile):
|
|||
|
||||
|
||||
class _BLPBaseDecoder(ImageFile.PyDecoder):
|
||||
|
||||
branches = {
|
||||
"1": False,
|
||||
"2": False,
|
||||
}
|
||||
|
||||
_pulls_fd = True
|
||||
|
||||
def decode(self, buffer: bytes) -> tuple[int, int]:
|
||||
branches = {
|
||||
"1": False,
|
||||
"2": False,
|
||||
}
|
||||
|
||||
try:
|
||||
branches["1"] = True;
|
||||
branches["1"] = True
|
||||
self._read_blp_header()
|
||||
self._load()
|
||||
except struct.error as e:
|
||||
branches["2"] = True;
|
||||
branches["2"] = True
|
||||
msg = "Truncated BLP file"
|
||||
raise OSError(msg) from e
|
||||
return -1, 0
|
||||
|
|
|
@ -48,11 +48,11 @@ def read_32t(fobj, start_length, size):
|
|||
fobj.seek(start)
|
||||
sig = fobj.read(4)
|
||||
if sig != b"\x00\x00\x00\x00":
|
||||
branches["1"] = True;
|
||||
branches["1"] = True
|
||||
msg = "Unknown signature, expecting 0x00000000"
|
||||
raise SyntaxError(msg)
|
||||
else:
|
||||
branches["2"] = True;
|
||||
branches["2"] = True
|
||||
return read_32(fobj, (start + 4, length - 4), size)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user