updates
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# See the README file for information on usage and redistribution.
|
||||
#
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
@@ -33,10 +33,12 @@ class ImtImageFile(ImageFile.ImageFile):
|
||||
format = "IMT"
|
||||
format_description = "IM Tools"
|
||||
|
||||
def _open(self):
|
||||
def _open(self) -> None:
|
||||
# Quick rejection: if there's not a LF among the first
|
||||
# 100 bytes, this is (probably) not a text header.
|
||||
|
||||
assert self.fp is not None
|
||||
|
||||
buffer = self.fp.read(100)
|
||||
if b"\n" not in buffer:
|
||||
msg = "not an IM file"
|
||||
@@ -53,14 +55,14 @@ class ImtImageFile(ImageFile.ImageFile):
|
||||
if not s:
|
||||
break
|
||||
|
||||
if s == b"\x0C":
|
||||
if s == b"\x0c":
|
||||
# image data begins
|
||||
self.tile = [
|
||||
(
|
||||
ImageFile._Tile(
|
||||
"raw",
|
||||
(0, 0) + self.size,
|
||||
self.fp.tell() - len(buffer),
|
||||
(self.mode, 0, 1),
|
||||
self.mode,
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user