Reduced number of bytes read for header

This commit is contained in:
Andrew Murray 2025-06-09 12:20:52 +10:00
parent 313969cf0b
commit 7341e70f6b

View File

@ -54,7 +54,7 @@ class PcxImageFile(ImageFile.ImageFile):
# header # header
assert self.fp is not None assert self.fp is not None
s = self.fp.read(128) s = self.fp.read(68)
if not _accept(s): if not _accept(s):
msg = "not a PCX file" msg = "not a PCX file"
raise SyntaxError(msg) raise SyntaxError(msg)
@ -66,7 +66,7 @@ class PcxImageFile(ImageFile.ImageFile):
raise SyntaxError(msg) raise SyntaxError(msg)
logger.debug("BBox: %s %s %s %s", *bbox) logger.debug("BBox: %s %s %s %s", *bbox)
offset = self.fp.tell() offset = self.fp.tell() + 60
# format # format
version = s[1] version = s[1]