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)
| 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]: |