mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-03 11:23:05 +03:00
moved branches into the class
This commit is contained in:
parent
d73ce6aa55
commit
5b375becfb
|
@ -40,10 +40,6 @@ 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
|
||||||
|
@ -290,11 +286,11 @@ class _BLPBaseDecoder(ImageFile.PyDecoder):
|
||||||
|
|
||||||
def decode(self, buffer: bytes) -> tuple[int, int]:
|
def decode(self, buffer: bytes) -> tuple[int, int]:
|
||||||
try:
|
try:
|
||||||
branches["1"] = True
|
_BLPBaseDecoder.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
|
_BLPBaseDecoder.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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user