Skip to content

Commit

Permalink
Fix calculation of image printed area (used in finding weighted DPI f…
Browse files Browse the repository at this point in the history
…or OCR)

Fixes #1334
  • Loading branch information
jbarlow83 committed Jun 21, 2024
1 parent 34c285c commit 0544d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ocrmypdf/pdfinfo/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def printed_area(self) -> float:
"""Physical area of the image in square inches."""
if not self.renderable:
return 0.0
return float(self.width * self.dpi.x * self.height * self.dpi.y)
return float((self.width / self.dpi.x) * (self.height / self.dpi.y))

def __repr__(self):
"""Return a string representation of the image."""
Expand Down

0 comments on commit 0544d06

Please sign in to comment.