MCPcopy
hub / github.com/python-pillow/Pillow / load

Method load

src/PIL/ImageFile.py:492–502  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

490 pass
491
492 def load(self) -> Image.core.PixelAccess | None:
493 loader = self._load()
494 if loader is None:
495 msg = f"cannot find loader for this {self.format} file"
496 raise OSError(msg)
497 image = loader.load(self)
498 assert image is not None
499 # become the other object (!)
500 self.__class__ = image.__class__ # type: ignore[assignment]
501 self.__dict__ = image.__dict__
502 return image.load()
503
504 @abc.abstractmethod
505 def _load(self) -> StubHandler | None:

Callers

nothing calls this directly

Calls 2

_loadMethod · 0.95
loadMethod · 0.45

Tested by

no test coverage detected