Update src/PIL/VtfImagePlugin.py

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
REDxEYE 2025-05-05 00:31:22 +03:00 committed by GitHub
parent f594d20623
commit 1eb30cf574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -391,7 +391,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
def _accept(prefix: bytes) -> bool:
valid_header = prefix[:4] == b"VTF\x00"
valid_header = prefix.startswith("VTF\x00")
valid_version = struct.unpack_from("<2I", prefix, 4) >= (7, 0)
return valid_header and valid_version