mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-03 18:52:38 +00:00
Make debug dump of pageinfo at the end of processing readable
This commit is contained in:
parent
427add3008
commit
c096b4ca8c
@ -1529,7 +1529,10 @@ def run_pipeline():
|
||||
_log.info("Output sent to stdout")
|
||||
|
||||
with _pdfinfo_lock:
|
||||
_log.debug(_pdfinfo)
|
||||
if options.verbose:
|
||||
from pprint import pformat
|
||||
referent = _pdfinfo._getvalue() # get the real list out of proxy
|
||||
_log.debug(pformat(referent))
|
||||
direction = {0: 'n', 90: 'e',
|
||||
180: 's', 270: 'w'}
|
||||
orientations = []
|
||||
|
||||
@ -326,9 +326,11 @@ def _find_page_regular_images(page, pageinfo, contentsinfo):
|
||||
image['dpi_w'] = max(dpi_w, image.get('dpi_w', 0))
|
||||
image['dpi_h'] = max(dpi_h, image.get('dpi_h', 0))
|
||||
|
||||
image['dpi_w'] = Decimal(image['dpi_w'])
|
||||
image['dpi_h'] = Decimal(image['dpi_h'])
|
||||
image['dpi'] = (image['dpi_w'] * image['dpi_h']) ** Decimal(0.5)
|
||||
DPI_PREC = Decimal('1.000')
|
||||
image['dpi_w'] = Decimal(image['dpi_w']).quantize(DPI_PREC)
|
||||
image['dpi_h'] = Decimal(image['dpi_h']).quantize(DPI_PREC)
|
||||
dpi = Decimal(image['dpi_w'] * image['dpi_h']).sqrt()
|
||||
image['dpi'] = dpi.quantize(DPI_PREC)
|
||||
yield image
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user