question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_image_to_string_with_image_type[jpeg2000] failure with tesseract >4.1.x

See original GitHub issue

pytesseract.pytesseract.TesseractError: (1, 'Error in pixReadStreamJp2k: function not present Error in pixReadStream: jp2: no pix returned Error in pixRead: pix not read Error during processing.')

pytesseract 0.3.10 tesseract 5.1.0 pillow 9.0.1 openjpeg2 2.4.0 pytest 7.1.0 python 3.10.2

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
mandreecommented, Mar 30, 2022

Same issue here. I debugged it, and in my case the root cause was determined as follows:

  • tesseract 5.1.0 (on FreeBSD 13.0 amd64) failed to process a JPEG2000 file, because:
  • tesseract uses leptonica for reading images; and
  • leptonica was compiled without OPENJPEG option, omitting the libopenjp2 library

The remedy for me was to recompile leptonica with OpenJPEG 2.4.0 support.

However for py-pytesseract, it should skip the test if there are indications that tesseract does not support JPEG2000.

1reaction
int3lcommented, Mar 16, 2022

At the moment, I don’t have tesseract 5.1.0 around + Arch instance in order to test if it is pytesseract related or tesseract specific issue. When I have time, I will try to boot up a container with that setup in order to check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

some images translated to text using Tesseract 4 throw an ...
Expected Behavior: No error. Suggested Fix: I am not sure. Right now I'm just running pytesseract.image_to_string in a try block.
Read more >
Pytesseract : "TesseractNotFound Error: tesseract is not ...
I see steps are scattered in different answers. Based on my recent experience with this pytesseract error on Windows, writing different ...
Read more >
Compilation guide for various platforms | tessdoc - GitHub Pages
Compilation guide for various platforms. Note: This documentation expects you to be familiar with compiling software on your operating system. Use the same ......
Read more >
Tesseract command line OCR tool (stable - 4.1.x) - Launchpad
Package Version Uploaded by leptonlib 1.78.0‑1+nmu1ppa1~xenial1 Alexander Pozdnyakov ( 2019‑04‑08 ) leptonlib 1.78.0‑1+nmu1ppa1~bionic1 Alexander Pozdnyakov ( 2019‑04‑08 ) leptonlib 1.76.0‑1+nmu1ppa1~trusty1 Alexander Pozdnyakov ( 2018‑05‑14 )
Read more >
Installing and using Tesseract 4 on windows 10 - Medium
Installing Tesseract 4 on a Windows Machine using .exe File: ... If you see any error like tesseract command not found , most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found