Skip to content

Commit

Permalink
image: fix for 0 dpi in png
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Nov 19, 2024
1 parent 39d913e commit 3e45ab8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xlsxwriter/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def _process_png(data):
y_density = unpack(">I", data[offset + 12 : offset + 16])[0]
units = unpack("b", data[offset + 16 : offset + 17])[0]

if units == 1:
if units == 1 and x_density > 0 and y_density > 0:
x_dpi = x_density * 0.0254
y_dpi = y_density * 0.0254

Expand Down

0 comments on commit 3e45ab8

Please sign in to comment.