According to the commit in URL leptonica-1.84.1 (or newer) requires libjpeg for reading and writing tiff files. If libjpeg is not enabled (jpeg USE flag) then eg. tesseract's text2image gives the following error: Error in pixWriteTiff: function not present This makes enabling tiff USE flag a false sense of full tiff support. Current workaround: downgrade to version 1.83.1 or enable jpeg and tiff to write tiff files. Reproducible: Always Steps to Reproduce: 1. build tesseract with tiff support 2. run command: text2image \ --resolution 200 \ --fonts_dir /usr/share/fonts \ --font "DejaVu Sans" \ --text file.txt \ --outputbase file Actual Results: Error in pixWriteTiff: function not present Rendered page 0 to file file.tif Expected Results: Command should render tiff file.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6db214e5a1768cbb2b7ad2b23eca57104db16f53 commit 6db214e5a1768cbb2b7ad2b23eca57104db16f53 Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2024-01-10 22:10:00 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2024-01-10 22:11:05 +0000 media-libs/leptonica: 1.84.1 requires JPEG support in libtiff Closes: https://bugs.gentoo.org/921682 Signed-off-by: James Le Cuirot <chewi@gentoo.org> .../leptonica/{leptonica-1.84.1.ebuild => leptonica-1.84.1-r1.ebuild} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
This is not working. Following the code (see linked URL): #if HAVE_LIBTIFF && HAVE_LIBJPEG ... HAVE_LIBJPEG is set when libjpeg is detected by leptonica during build time (https://github.com/DanBloomberg/leptonica/blob/master/configure.ac#L81). This has nothing to do with tiff being built with jpeg support. To me this looks more like tiff USE flag implies jpeg USE flag (and this is what I can confirm with tests).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41c1ba18cc62836f4510034993c82c206fdbab21 commit 41c1ba18cc62836f4510034993c82c206fdbab21 Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2024-01-11 22:14:30 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2024-01-11 22:14:30 +0000 media-libs/leptonica: 1.84.1 requires JPEG support for TIFF support I got this slightly wrong before. JPEG support in libtiff itself seemingly doesn't matter, except in the tests. Closes: https://bugs.gentoo.org/921682 Signed-off-by: James Le Cuirot <chewi@gentoo.org> .../{leptonica-1.84.1-r1.ebuild => leptonica-1.84.1-r2.ebuild} | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)