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

Method _native_size

src/pptx/parts/image.py:121–133  ·  view source on GitHub ↗

A (width, height) 2-tuple representing the native dimensions of the image in EMU. Calculated based on the image DPI value, if present, assuming 72 dpi as a default.

(self)

Source from the content-addressed store, hash-verified

119
120 @property
121 def _native_size(self) -> tuple[Length, Length]:
122 """A (width, height) 2-tuple representing the native dimensions of the image in EMU.
123
124 Calculated based on the image DPI value, if present, assuming 72 dpi as a default.
125 """
126 EMU_PER_INCH = 914400
127 horz_dpi, vert_dpi = self._dpi
128 width_px, height_px = self._px_size
129
130 width = EMU_PER_INCH * width_px / horz_dpi
131 height = EMU_PER_INCH * height_px / vert_dpi
132
133 return Emu(int(width)), Emu(int(height))
134
135 @property
136 def _px_size(self) -> tuple[int, int]:

Callers

nothing calls this directly

Calls 1

EmuClass · 0.90

Tested by

no test coverage detected