tesserocr icon indicating copy to clipboard operation
tesserocr copied to clipboard

Segfault when used with PyMuPDF (aka fitz)

Open danem opened this issue 1 year ago • 0 comments

Tesserocr segfaults when used in conjunction with PyMuPDF (aka fitz).

from PIL import Image
import fitz # bug only seems to occur when fitz is imported *first*
import tesserocr

img = Image.open("img.png")
tesserocr.image_to_text(img) # segfault occurs here

I haven't fully investigated the cause but maybe it's related to https://github.com/sirfz/tesserocr/issues/32 as both tesserocr and fitz look at TESSDATA.

As a workaround I can simply reorder the imports.

danem avatar Oct 31 '23 20:10 danem