mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +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
|
from . import Image, ImageFile
|
||||||
|
|
||||||
|
branches = {
|
||||||
|
"1": False,
|
||||||
|
"2": False,
|
||||||
|
}
|
||||||
|
|
||||||
class Format(IntEnum):
|
class Format(IntEnum):
|
||||||
JPEG = 0
|
JPEG = 0
|
||||||
|
|
||||||
|
@ -276,22 +281,20 @@ class BlpImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
|
|
||||||
class _BLPBaseDecoder(ImageFile.PyDecoder):
|
class _BLPBaseDecoder(ImageFile.PyDecoder):
|
||||||
|
branches = {
|
||||||
|
"1": False,
|
||||||
|
"2": False,
|
||||||
|
}
|
||||||
|
|
||||||
_pulls_fd = True
|
_pulls_fd = True
|
||||||
|
|
||||||
def decode(self, buffer: bytes) -> tuple[int, int]:
|
def decode(self, buffer: bytes) -> tuple[int, int]:
|
||||||
branches = {
|
|
||||||
"1": False,
|
|
||||||
"2": False,
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
branches["1"] = True;
|
branches["1"] = True
|
||||||
self._read_blp_header()
|
self._read_blp_header()
|
||||||
self._load()
|
self._load()
|
||||||
except struct.error as e:
|
except struct.error as e:
|
||||||
branches["2"] = True;
|
branches["2"] = True
|
||||||
msg = "Truncated BLP file"
|
msg = "Truncated BLP file"
|
||||||
raise OSError(msg) from e
|
raise OSError(msg) from e
|
||||||
return -1, 0
|
return -1, 0
|
||||||
|
|
|
@ -48,11 +48,11 @@ def read_32t(fobj, start_length, size):
|
||||||
fobj.seek(start)
|
fobj.seek(start)
|
||||||
sig = fobj.read(4)
|
sig = fobj.read(4)
|
||||||
if sig != b"\x00\x00\x00\x00":
|
if sig != b"\x00\x00\x00\x00":
|
||||||
branches["1"] = True;
|
branches["1"] = True
|
||||||
msg = "Unknown signature, expecting 0x00000000"
|
msg = "Unknown signature, expecting 0x00000000"
|
||||||
raise SyntaxError(msg)
|
raise SyntaxError(msg)
|
||||||
else:
|
else:
|
||||||
branches["2"] = True;
|
branches["2"] = True
|
||||||
return read_32(fobj, (start + 4, length - 4), size)
|
return read_32(fobj, (start + 4, length - 4), size)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user