MCPcopy Index your code
hub / github.com/python-pillow/Pillow / layers

Method layers

src/PIL/PsdImagePlugin.py:148–159  ·  view source on GitHub ↗
(
        self,
    )

Source from the content-addressed store, hash-verified

146
147 @cached_property
148 def layers(
149 self,
150 ) -> list[tuple[str, str, tuple[int, int, int, int], list[ImageFile._Tile]]]:
151 layers = []
152 if self._layers_position is not None:
153 if isinstance(self._fp, DeferredError):
154 raise self._fp.ex
155 self._fp.seek(self._layers_position)
156 _layer_data = io.BytesIO(ImageFile._safe_read(self._fp, self._layers_size))
157 layers = _layerinfo(_layer_data, self._layers_size)
158 self._n_frames = len(layers)
159 return layers
160
161 @property
162 def n_frames(self) -> int:

Callers

nothing calls this directly

Calls 3

_layerinfoFunction · 0.85
_safe_readMethod · 0.80
seekMethod · 0.45

Tested by

no test coverage detected