DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.76k stars 389 forks source link

bad tiff file: tiffbpl is too small #568

Closed diazGT94 closed 1 year ago

diazGT94 commented 3 years ago

I create a tif file with 70 jpg images that I've but when I try use it for training it gives me the following error.:

Error in pixReadFromTiffStream: bad tiff file: tiffbpl is too small

DanBloomberg commented 3 years ago

please include an example tiff file

diazGT94 commented 3 years ago

Here is the tiff file that I'm trying to use. test.zip

DanBloomberg commented 3 years ago

I had no trouble reading the 85 images in that file. What version of leptonica are you using?

pix1 = pixRead("/tmp/test.tif");
    pixDisplay(pix1, 100, 0);
    pixa1 = pixaReadMultipageTiff("/tmp/test.tif");
    lept_stderr("npages = %d\n", pixaGetCount(pixa1));
    pix3 = pixaDisplayTiledInColumns(pixa1, 4, 1.0, 15, 0);
    pixWrite("/tmp/85.png", pix3, IFF_PNG);

85

rajeshmurugan commented 3 years ago

I am facing the same issue using the attached test.tiff. my Leptonica version is 1.79.0 and using Ubuntu 18.0.

$ tesseract ../test.tif pdf
Tesseract Open Source OCR Engine v4.1.1 with Leptonica
Error in pixReadFromTiffStream: bad tiff file: tiffbpl is too small
$ tesseract --version
tesseract 4.1.1
 leptonica-1.79.0
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 2.0.3) : libpng 1.6.37 : libtiff 4.1.0 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.1
 Found AVX
 Found SSE
 Found libarchive 3.4.0 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.8 liblz4/1.9.2 libzstd/1.4.4
zdenop commented 3 years ago

"attached test.tiff" is from https://github.com/DanBloomberg/leptonica/issues/568#issuecomment-777739320 ? did you tried the latest version of leptonica (1.81) and libtiff (BTW: 4.3 should be released soon https://libtiff.gitlab.io/libtiff/v4.3.0.html)

rajeshmurugan commented 3 years ago

Yes, attached test.tiff is from #568. Okay, I will try and let you know the outcome.

drdilyor commented 3 years ago

How did you managed solving the issue, please let us know :)))

DanBloomberg commented 1 year ago

No action over 20 months to provide evidence for this issue. Closing for now.