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

Method _dpi

src/docx/image/bmp.py:38–43  ·  view source on GitHub ↗

Return the integer pixels per inch from `px_per_meter`, defaulting to 96 if `px_per_meter` is zero.

(px_per_meter)

Source from the content-addressed store, hash-verified

36
37 @staticmethod
38 def _dpi(px_per_meter):
39 """Return the integer pixels per inch from `px_per_meter`, defaulting to 96 if
40 `px_per_meter` is zero."""
41 if px_per_meter == 0:
42 return 96
43 return int(round(px_per_meter * 0.0254))

Callers 1

from_streamMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected