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 18, 2024
1 parent d0cb2c1 commit f6de04a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Excel/Writer/XLSX/Utility.pm
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ sub _process_png {
my $y_ppu = unpack "N", substr $data, $offset + 12, 4;
my $units = unpack "C", substr $data, $offset + 16, 1;

if ( $units == 1 ) {
if ( $units == 1 && $x_ppu && $y_ppu) {
$x_dpi = $x_ppu * 0.0254;
$y_dpi = $y_ppu * 0.0254;
}
Expand Down

0 comments on commit f6de04a

Please sign in to comment.