madmaze / pytesseract

A Python wrapper for Google Tesseract

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

output_type=pytesseract.Output.STRING still provides bytes object

aaravrav opened this issue · comments

commented

Changing the output_type parameter for the image_to_string still provides bytes object, even though pytesseract.Output.STRING is the default

Please provide some more details for us to be able to reproduce this, as I cannot see any issue here:

>>> pytesseract.image_to_string(image)
'This is my text.\n\x0c'
>>> pytesseract.image_to_string(image, output_type=pytesseract.Output.STRING)
'This is my text.\n\x0c'
>>> pytesseract.image_to_string(image, output_type=pytesseract.Output.BYTES)
b'This is my text.\n\x0c'
>>> 
commented

Somehow it was a problem with my IDE? I updated it and it got rid of the problem