updates
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#
|
||||
# See the README file for information on usage and redistribution.
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from . import Image, ImageFile
|
||||
from ._binary import i16le as i16
|
||||
@@ -26,8 +27,8 @@ from ._binary import i16le as i16
|
||||
# helpers
|
||||
|
||||
|
||||
def _accept(prefix):
|
||||
return prefix[:4] == b"\200\350\000\000"
|
||||
def _accept(prefix: bytes) -> bool:
|
||||
return prefix.startswith(b"\200\350\000\000")
|
||||
|
||||
|
||||
##
|
||||
@@ -38,8 +39,10 @@ class PixarImageFile(ImageFile.ImageFile):
|
||||
format = "PIXAR"
|
||||
format_description = "PIXAR raster image"
|
||||
|
||||
def _open(self):
|
||||
def _open(self) -> None:
|
||||
# assuming a 4-byte magic label
|
||||
assert self.fp is not None
|
||||
|
||||
s = self.fp.read(4)
|
||||
if not _accept(s):
|
||||
msg = "not a PIXAR file"
|
||||
@@ -58,7 +61,7 @@ class PixarImageFile(ImageFile.ImageFile):
|
||||
# FIXME: to be continued...
|
||||
|
||||
# create tile descriptor (assuming "dumped")
|
||||
self.tile = [("raw", (0, 0) + self.size, 1024, (self.mode, 0, 1))]
|
||||
self.tile = [ImageFile._Tile("raw", (0, 0) + self.size, 1024, self.mode)]
|
||||
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user