0
votes

I am trying to convert PNG image file to text using pytesseract. It is giving me the below error.
TesseractError: (1, 'Tesseract Open Source OCR Engine v3.05.00dev with Leptonica Warning in pixReadMemPng: work-around: writing to a temp file libpng warning: Application built with libpng-1.4.3 but running with 1.5.14 Error in pixReadStreamPng: png_ptr not made Error in pixReadMemPng: pix not read Error in pixReadMem: png: no pix returned Error during processing.')

When i do tesseract -v
tesseract 3.05.00dev
leptonica-1.72
libjpeg 9 : libpng 1.5.14 : libtiff 4.0.3 : zlib 1.2.5 : libopenjp2 2.1.0

1

1 Answers

0
votes

I also meet this problem, and I can't find the answer on the internet.

But I try to download the tesseract-ocr and install it, then:

  1. set environment variable, TESSDATA_PREFIX:"C:\Program Files (x86)\Tesseract-OCR\tessdata"
  2. add C:\Program Files (x86)\Tesseract-OCR to the path variable.
  3. edit pytesseract.py in Line 35, tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe'

When I call pytesseract.image_to_string(img) in anaconda prompt, it return a string. My Environment:

  • pytesseract 0.2.6
  • pillow 5.2.0
  • tesseract 4.00.00alpha