traceback error
zainabz1995 opened this issue · 6 comments
You need to install Pillow instead of default PIL on your machine:
cmd >> pip install pillow
from python/scripts
Traceback (most recent call last):
File "main.py", line 49, in
text = image_to_string(im)
File "/Users/ME//Desktop/ocr-convert-image-to-text/pytesser/pytesser.py", line 30, in image_to_string
util.image_to_scratch(im, scratch_image_name)
File "/Users/ME/Desktop/ocr-convert-image-to-text/pytesser/util.py", line 7, in image_to_scratch
im.save(scratch_image_name, dpi=(200,200))
File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1405, in save
save_handler(self, fp, filename)
File "/usr/local/lib/python2.7/site-packages/PIL/BmpImagePlugin.py", line 197, in _save
raise IOError("cannot write mode %s as BMP" % im.mode)
IOError: cannot write mode RGBA as BMP
I have pillow . Still getting this error why it is so ?
$ python main.py sample
/Users/pc/Downloads/ocr-convert-image-to-text-master/sample/file-page1.jpg
Traceback (most recent call last):
File "main.py", line 51, in
text = image_to_string(im)
File "/Users/pc/Downloads/ocr-convert-image-to-text-master/pytesser/pytesser.py", line 31, in image_to_string
call_tesseract(scratch_image_name, scratch_text_name_root)
File "/Users/pc/Downloads/ocr-convert-image-to-text-master/pytesser/pytesser.py", line 21, in call_tesseract
proc = subprocess.Popen(args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I have made some changes in commit d476fc6
That should solve this issue as well, kindly refer to the same. If anyone of you guys face any problem after updating as well, feel free to reopen this issue or open a new one.
@pcakhilnadh Kindly refer to #4