"Leptonica was build without TIFF support! Disabling TIFF support..."

201 views
Skip to first unread message

DJuego Director De Juego

unread,
Oct 8, 2023, 3:56:19 PM10/8/23
to tesseract-ocr
Hi, Tesseract Community. My first message.

Today I built the leptonica project with TIFF support.  See figure. The build seems to have been a success. 

But when I build Tesseract linking it to Leptonica it doesn't seem to detect TIFF support. In fact it claims that leptonica has no support and states that it disables its own support.  See picture

What could be going on? Any suggestion?

DJuego

Zdenko Podobny

unread,
Oct 9, 2023, 2:26:58 AM10/9/23
to dju...@gmail.com, tesseract-ocr
Please provide full logs including installation, configure parameters etc. - not screenshots.
Make should you have only one installation of leptonica library
May your own test if leptonica is built with tiff.
Use release target and not debug.

Zdenko


ne 8. 10. 2023 o 21:56 DJuego Director De Juego <dju...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/e569ecdc-d013-46e6-ac16-c97992ec3420n%40googlegroups.com.

DJuego Director De Juego

unread,
Oct 14, 2023, 10:13:17 AM10/14/23
to tesseract-ocr
a) I have attached the construction logs of leptonica and tesseract.  Yes, I can guarantee that I only have one version of leptonica installed. 

For leptonica and tesseract I use a script for the build. 

And they seem to work fine because it generates all the files I need and gives no errors. Here I present the excerpts from the script that I think are the decisive ones. 

For debug
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D SW_BUILD:BOOL=OFF -D BUILD_PROG:BOOL=ON -D ENABLE_TIFF:BOOL=ON -D ENABLE_ZLIB:BOOL=ON -D ENABLE_PNG:BOOL=ON -D ENABLE_JPEG:BOOL=ON -D ENABLE_GIF:BOOL=ON -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA/DEBUG -D ZLIB_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/zlib/DEBUG/lib/zlibd.lib -D ZLIB_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/zlib/RELEASE/lib/zlib.lib  -D ZLIB_INCLUDE_DIR=$DIRECTORIO_INSTALACION/zlib/DEBUG/include -D TIFF_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/tiff/DEBUG/lib/tiffd.lib -D TIFF_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/tiff/RELEASE/lib/tiff.lib  -D TIFF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/tiff/DEBUG/include -D PNG_LIBRARY=$DIRECTORIO_INSTALACION/libpng/DEBUG/lib/libpng16d.lib -D PNG_PNG_INCLUDE_DIR=$DIRECTORIO_INSTALACION/libpng/DEBUG/include -D JPEG_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/jpeg/DEBUG/lib/jpeg.lib -D JPEG_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/jpeg/RELEASE/lib/jpeg.lib -D JPEG_INCLUDE_DIR=$DIRECTORIO_INSTALACION/jpeg/DEBUG/include -D GIF_LIBRARY=$DIRECTORIO_INSTALACION/giflib/DEBUG/lib/gif.lib -D GIF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/giflib/DEBUG/include ../..
 nmake
 nmake install

For release
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Release -D SW_BUILD:BOOL=OFF -D BUILD_PROG:BOOL=ON -D ENABLE_TIFF:BOOL=ON -D ENABLE_ZLIB:BOOL=ON -D ENABLE_PNG:BOOL=ON -D ENABLE_JPEG:BOOL=ON -D ENABLE_GIF:BOOL=ON -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA/RELEASE -D ZLIB_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/zlib/DEBUG/lib/zlibd.lib -D ZLIB_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/zlib/RELEASE/lib/zlib.lib -D ZLIB_INCLUDE_DIR=$DIRECTORIO_INSTALACION/zlib/RELEASE/include -D TIFF_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/tiff/DEBUG/lib/tiffd.lib -D TIFF_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/tiff/RELEASE/lib/tiff.lib -D TIFF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/tiff/RELEASE/include -D PNG_LIBRARY=$DIRECTORIO_INSTALACION/libpng/RELEASE/lib/libpng16.lib -D PNG_PNG_INCLUDE_DIR=$DIRECTORIO_INSTALACION/libpng/RELEASE/include -D JPEG_LIBRARY_DEBUG=$DIRECTORIO_INSTALACION/jpeg/DEBUG/lib/jpeg.lib -D JPEG_LIBRARY_RELEASE=$DIRECTORIO_INSTALACION/jpeg/RELEASE/lib/jpeg.lib -D JPEG_INCLUDE_DIR=$DIRECTORIO_INSTALACION/jpeg/RELEASE/include -D GIF_LIBRARY=$DIRECTORIO_INSTALACION/giflib/RELEASE/lib/gif.lib -D GIF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/giflib/RELEASE/include ../..
 nmake
 nmake install


For debug
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D SW_BUILD:BOOL=OFF -D BUILD_TRAINING_TOOLS:BOOL=OFF -D Leptonica_DIR=$DIRECTORIO_INSTALACION/leptonica/DEBUG/lib/cmake/leptonica -D TIFF_LIBRARY=$DIRECTORIO_INSTALACION/tiff/DEBUG/lib/tiffd.lib -D TIFF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/tiff/DEBUG/include -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA/DEBUG ../..
nmake
nmake install

For release
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Release -D SW_BUILD:BOOL=OFF -D BUILD_TRAINING_TOOLS:BOOL=OFF -D Leptonica_DIR=$DIRECTORIO_INSTALACION/leptonica/RELEASE/lib/cmake/leptonica -D TIFF_LIBRARY=$DIRECTORIO_INSTALACION/tiff/RELEASE/lib/tiff.lib -D TIFF_INCLUDE_DIR=$DIRECTORIO_INSTALACION/tiff/RELEASE/include -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA/RELEASE ../..
nmake
nmake install

Everything seems to be working perfectly. The only issue has to do with the message:

"-- Found leptonica version: 1.84.0
Leptonica was build without TIFF support! Disabling TIFF support...
-- TIFF support disabled.
"

I think the message is incorrect because the tesseract.exe executable that is generated needs zlib.dll, tiff.dll and libpng16.dll (in the same folder) to run. :-)

DJuego



log_leptonica.txt
log_tesseract.txt

Zdenko Podobny

unread,
Oct 15, 2023, 10:19:38 AM10/15/23
to tesser...@googlegroups.com
Honestly, this is a very messy configuration for me. Why? Tesseract (and other projects) use CMake to avoid such manual settings.

Just follow the example in our GitHub action for cmake&windows[1] - it is simply stupid and it works. Cmake takes care of correct linking (debug/release), and build (no need to run nmake)



so 14. 10. 2023 o 16:13 DJuego Director De Juego <dju...@gmail.com> napísal(a):
Reply all
Reply to author
Forward
0 new messages