Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921682 - >=media-libs/leptonica-1.84.1 requires libjpeg for tiff support
Summary: >=media-libs/leptonica-1.84.1 requires libjpeg for tiff support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: James Le Cuirot
URL: https://github.com/DanBloomberg/lepto...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-09 22:45 UTC by Marcin Deranek
Modified: 2024-01-11 22:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Deranek 2024-01-09 22:45:48 UTC
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.
Comment 1 Larry the Git Cow gentoo-dev 2024-01-10 22:11:35 UTC
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(-)
Comment 2 Marcin Deranek 2024-01-11 07:19:41 UTC
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).
Comment 3 Larry the Git Cow gentoo-dev 2024-01-11 22:17:32 UTC
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(-)