qixiaobo / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

tesseract error in pixReadStreamJpeg : function not present #391

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Took an svn readonly checkout of tesseract 3.0 and downloaded leptonica from 
project source
2.Installed leptonica-1.66 , tesseract 3.0 from source code
3. Ran `tesseract image.jpg output.txt`

What is the expected output? What do you see instead?
Expected tesseract to produce the OCR result.  Got the following errors

Tesseract Open Source OCR Engine with Leptonica
Error in pixReadStreamJpeg: function not present
Error in pixReadStream: jpeg: no pix returned
Error in pixGetInputFormat: pix not defined
Error in pixRead: image not returned
Error in fopenReadStream: file not found
Error in pixRead: image file not found
Image file ÿØÿà cannot be read!

What version of the product are you using? On what operating system?
tesseract 3.0
leptonica-1.66
Fedora 13 (AMD 64)

Please provide any additional information below.
For Fedora , I had to install libjpeg-devel , libpng-devel and libtiff-devel.
zlib was already there in the system.
I have also tried tesseract to run on png , tiff files but they all have given 
errors related to lepontica
wondering if its an installation problem in tesseract or lepontica or whether 
the OS is the problem.

Original issue reported on code.google.com by sourasis...@gmail.com on 26 Oct 2010 at 11:20

GoogleCodeExporter commented 9 years ago
The issue has been solved. It was installation of tesseract. I had to reinstall 
everything as root and then it worked ! Still I guess the post gives a good 
installation case in Fedora for whoever might need it.

Original comment by sourasis...@gmail.com on 26 Oct 2010 at 12:06

GoogleCodeExporter commented 9 years ago

Original comment by zde...@gmail.com on 26 Oct 2010 at 12:25

GoogleCodeExporter commented 9 years ago
Actually, it looks very much like you forgot to run 'ldconfig' as root. 
Reinstalling sometimes accidentally invokes that, in some odd situations, but 
this is Linux 101 stuff.

Original comment by joregan on 29 Oct 2010 at 5:59

GoogleCodeExporter commented 9 years ago
moved to FAQ:
http://code.google.com/p/tesseract-ocr/wiki/FAQ?ts=1331068532&updated=FAQ#Error_
in_pixReadStream:

Original comment by zde...@gmail.com on 6 Mar 2012 at 9:18

GoogleCodeExporter commented 9 years ago
I had this same issue on fedora core 16. libpng wasn't enough. I had to yum 
install libpng-devel, then reinstall leptonica (after make clean) which got rid 
of this error.

Original comment by jebbe...@gmail.com on 23 Apr 2012 at 3:02

GoogleCodeExporter commented 9 years ago
@jebbeich: this is not problem of tesseract and IMO neither of leptonica.

Original comment by zde...@gmail.com on 23 Apr 2012 at 7:12

GoogleCodeExporter commented 9 years ago
is there a libpng-devel equivalent for mac?

Original comment by dyua...@gmail.com on 2 Aug 2012 at 9:32

GoogleCodeExporter commented 9 years ago
I don't think you need libpng-devel.

For mac, I did this:

`sudo port install jpeg tiff libpng`

After this, I located the directories where port installed files corresponding 
to these packages for e.g.
sudo port contents jpeg
Port jpeg contains:
  /opt/local/bin/cjpeg
  /opt/local/bin/djpeg
  /opt/local/bin/jpegtran
  /opt/local/bin/rdjpgcom
  /opt/local/bin/wrjpgcom
  /opt/local/include/jconfig.h
  /opt/local/include/jerror.h
  /opt/local/include/jmorecfg.h
  /opt/local/include/jpeglib.h
  /opt/local/lib/libjpeg.9.dylib
  /opt/local/lib/libjpeg.a
  /opt/local/lib/libjpeg.dylib
  /opt/local/share/doc/jpeg/README
  /opt/local/share/doc/jpeg/change.log
  /opt/local/share/doc/jpeg/libjpeg.txt
  /opt/local/share/doc/jpeg/structure.txt
  /opt/local/share/doc/jpeg/usage.txt
  /opt/local/share/doc/jpeg/wizard.txt
  /opt/local/share/man/man1/cjpeg.1.gz
  /opt/local/share/man/man1/djpeg.1.gz
  /opt/local/share/man/man1/jpegtran.1.gz
  /opt/local/share/man/man1/rdjpgcom.1.gz
  /opt/local/share/man/man1/wrjpgcom.1.gz

Next, I went back to leptonica source folder and ran:
`./configure LDFLAGS=-L/opt/local/lib/ CFLAGS=-I/opt/local/include/`
`make`
`sudo make install`

At this point, your leptonica should be installed with support for png, jpeg 
and tiff.

Now, when I run `tesseract some.jpg output`, it runs without error.

Original comment by prateekb...@gmail.com on 19 Sep 2014 at 6:01