You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to ocrmypdf a jpg which comes from a ultrasound scanner.
My windows viewer says 96dpi, but ocrmypdf fails with a message that image resolution could not be retrieved
This the traceback: Traceback (most recent call last): File "/opt/ocr/.vscode/Medistarlinks/link2MEDISTAR.py", line 262, in DoOCR res=ocrmypdf.ocr(filename, output_file=tmpfile+'.pdf',language='deu+eng',title='OCR FAX von '+xxx, \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/api.py", line 380, in ocr return run_pipeline(options=options, plugin_manager=plugin_manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipelines/ocr.py", line 223, in run_pipeline return _run_pipeline(options, plugin_manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipelines/ocr.py", line 169, in _run_pipeline origin_pdf = triage( ^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipeline.py", line 170, in triage triage_image_file(input_file, output_file, options) File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipeline.py", line 97, in triage_image_file raise DpiError( ocrmypdf.exceptions.DpiError: Input file is an image, but has no resolution (DPI) in its metadata. Estimate the resolution at which image was scanned and specify it using --image-dpi.
Is there an ysolution? I cannot change the way the jpg is created
Steps to reproduce
1. Run ocrmypdf -v1 ...arguments... input.pdf output.pdf
2. Open output.pdf
3. ...
Files
No response
How did you download and install the software?
No response
OCRmyPDF version
No response
Relevant log output
The text was updated successfully, but these errors were encountered:
When Windows reports "96 dpi", it probably means that the image contains no DPI information, and Windows guesses a default value of 96 dpi. (Some programs assume 72.)
OCRmyPDF does not make that assumption - there are real world cases where assuming or guessing DPI will give wrong results, and it's best to let the user determine the DPI and enter the correct value.
You can just use ocrmypdf --image-dpi 96 image.png ultrasound.pdf
Describe the bug
I am trying to ocrmypdf a jpg which comes from a ultrasound scanner.
My windows viewer says 96dpi, but ocrmypdf fails with a message that image resolution could not be retrieved
This the traceback:
Traceback (most recent call last): File "/opt/ocr/.vscode/Medistarlinks/link2MEDISTAR.py", line 262, in DoOCR res=ocrmypdf.ocr(filename, output_file=tmpfile+'.pdf',language='deu+eng',title='OCR FAX von '+xxx, \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/api.py", line 380, in ocr return run_pipeline(options=options, plugin_manager=plugin_manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipelines/ocr.py", line 223, in run_pipeline return _run_pipeline(options, plugin_manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipelines/ocr.py", line 169, in _run_pipeline origin_pdf = triage( ^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipeline.py", line 170, in triage triage_image_file(input_file, output_file, options) File "/usr/local/lib/python3.11/dist-packages/ocrmypdf/_pipeline.py", line 97, in triage_image_file raise DpiError( ocrmypdf.exceptions.DpiError: Input file is an image, but has no resolution (DPI) in its metadata. Estimate the resolution at which image was scanned and specify it using --image-dpi.
Is there an ysolution? I cannot change the way the jpg is created
Steps to reproduce
Files
No response
How did you download and install the software?
No response
OCRmyPDF version
No response
Relevant log output
The text was updated successfully, but these errors were encountered: