mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-22 10:12:00 +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
|
||||
|
||||
branches = {
|
||||
"1": False,
|
||||
"2": False,
|
||||
}
|
||||
|
||||
class Format(IntEnum):
|
||||
JPEG = 0
|
||||
|
@ -290,11 +286,11 @@ class _BLPBaseDecoder(ImageFile.PyDecoder):
|
|||
|
||||
def decode(self, buffer: bytes) -> tuple[int, int]:
|
||||
try:
|
||||
branches["1"] = True
|
||||
_BLPBaseDecoder.branches["1"] = True
|
||||
self._read_blp_header()
|
||||
self._load()
|
||||
except struct.error as e:
|
||||
branches["2"] = True
|
||||
_BLPBaseDecoder.branches["2"] = True
|
||||
msg = "Truncated BLP file"
|
||||
raise OSError(msg) from e
|
||||
return -1, 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user