MCPcopy Create free account
hub / github.com/scanny/python-pptx / get_image

Method get_image

src/pptx/parts/slide.py:35–41  ·  view source on GitHub ↗

Return an |Image| object containing the image related to this slide by *rId*. Raises |KeyError| if no image is related by that id, which would generally indicate a corrupted .pptx file.

(self, rId: str)

Source from the content-addressed store, hash-verified

33 _element: CT_Slide
34
35 def get_image(self, rId: str) -> Image:
36 """Return an |Image| object containing the image related to this slide by *rId*.
37
38 Raises |KeyError| if no image is related by that id, which would generally indicate a
39 corrupted .pptx file.
40 """
41 return cast("ImagePart", self.related_part(rId)).image
42
43 def get_or_add_image_part(self, image_file: str | IO[bytes]):
44 """Return `(image_part, rId)` pair corresponding to `image_file`.

Callers 3

poster_frameMethod · 0.80
imageMethod · 0.80

Calls 1

related_partMethod · 0.80

Tested by 1