Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docx/image/tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ def _dpi(self, resolution_tag):
"""
if resolution_tag not in self._ifd_entries:
return 72
resolution_unit = self._ifd_entries[TIFF_TAG.RESOLUTION_UNIT]

# get resolution unit, assume inches if not specified
if TIFF_TAG.RESOLUTION_UNIT not in self._ifd_entries:
resolution_unit = 2
else:
resolution_unit = self._ifd_entries[TIFF_TAG.RESOLUTION_UNIT]

if resolution_unit == 1: # aspect ratio only
return 72
# resolution_unit == 2 for inches, 3 for centimeters
Expand Down