tesseract.js: Incorrect header check at Zlib._handle.onerror (zlib.js:363:17)

I’m trying to process an image which is saved locally in my node server. I’m getting following error:

2017-06-17T16:12:45.087797+00:00 app[web.1]: File write complete-- /app/sample.png 2017-06-17T16:12:46.065537+00:00 app[web.1]: pre-main prep time: 61 ms 2017-06-17T16:12:46.114192+00:00 app[web.1]: events.js:154 2017-06-17T16:12:46.114195+00:00 app[web.1]: throw er; // Unhandled ‘error’ event 2017-06-17T16:12:46.114196+00:00 app[web.1]: ^ 2017-06-17T16:12:46.114197+00:00 app[web.1]: 2017-06-17T16:12:46.114198+00:00 app[web.1]: Error: incorrect header check 2017-06-17T16:12:46.114201+00:00 app[web.1]: at Zlib._handle.onerror (zlib.js:363:17)

Here is my code:

Tesseract.recognize(completeFilePath)
   .then(function(data) {
   		console.log('Job completed');
   	})
   	.catch(function(err){
        console.log('catch\n', err);
     })
   	.finally(function(e){
        console.log('Finally');
        //cleanup temp file
     });

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 8
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to fix this issue by downloading eng.traineddata and placing it in my root directory.

fixx

Had the same problem, solved by manually downloading eng.traineddata.

I have the same problem. Tesseractjs is useless in node.js until this issue is solved

@robomotic for me it the same directory where my index.js is:

.
├── eng.traineddata
├── images
├── index.js
├── node_modules
├── ocr.js
├── package-lock.json
└── package.json

I’m facing the issue without using language option as well.