MCPcopy Index your code
hub / github.com/python-openxml/python-docx / from_image

Method from_image

src/docx/parts/image.py:60–63  ·  view source on GitHub ↗

Return an |ImagePart| instance newly created from `image` and assigned `partname`.

(cls, image: Image, partname: PackURI)

Source from the content-addressed store, hash-verified

58
59 @classmethod
60 def from_image(cls, image: Image, partname: PackURI):
61 """Return an |ImagePart| instance newly created from `image` and assigned
62 `partname`."""
63 return ImagePart(partname, image.content_type, image.blob, image)
64
65 @property
66 def image(self) -> Image:

Callers 3

_add_image_partMethod · 0.80
dimensions_fixtureMethod · 0.80

Calls 1

ImagePartClass · 0.85

Tested by 2

dimensions_fixtureMethod · 0.64