Compare commits

...
2 changed files with 12 additions and 18 deletions
+4 -18
View File
@@ -17,32 +17,16 @@ FROM base as builder
# Note we need leptonica here to build jbig2 # Note we need leptonica here to build jbig2
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential autoconf automake libtool \
libleptonica-dev \
zlib1g-dev \
python3-dev \ python3-dev \
python3-distutils \ python3-distutils \
libffi-dev \
ca-certificates \ ca-certificates \
curl \ curl \
git \ git \
libcairo2-dev \ libcairo2-dev \
pkg-config pkg-config
# Get the latest pip (Ubuntu version doesn't support manylinux2010) # Get the latest pip
RUN \ RUN curl https://bootstrap.pypa.io/get-pip.py | python3
curl https://bootstrap.pypa.io/get-pip.py | python3
# Compile and install jbig2
# Needs libleptonica-dev, zlib1g-dev
RUN \
mkdir jbig2 \
&& curl -L https://github.com/agl/jbig2enc/archive/ea6a40a.tar.gz | \
tar xz -C jbig2 --strip-components=1 \
&& cd jbig2 \
&& ./autogen.sh && ./configure && make && make install \
&& cd .. \
&& rm -rf jbig2
COPY . /app COPY . /app
@@ -56,11 +40,13 @@ FROM base
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common gpg-agent software-properties-common gpg-agent
RUN add-apt-repository -y ppa:alex-p/tesseract-ocr-devel RUN add-apt-repository -y ppa:alex-p/tesseract-ocr-devel
RUN add-apt-repository -y ppa:alex-p/jbig2enc
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
ghostscript \ ghostscript \
fonts-droid-fallback \ fonts-droid-fallback \
jbig2dec \ jbig2dec \
jbig2 \
img2pdf \ img2pdf \
libsm6 libxext6 libxrender-dev \ libsm6 libxext6 libxrender-dev \
pngquant \ pngquant \
+8
View File
@@ -24,6 +24,14 @@ On macOS, Homebrew packages jbig2enc and OCRmyPDF includes it by
default. The Docker image for OCRmyPDF also builds its own JBIG2 encoder default. The Docker image for OCRmyPDF also builds its own JBIG2 encoder
from source. from source.
On Ubuntu, you can install the JBIG2 encoder using the following PPA:
.. code-block:: bash
sudo add-apt-repository ppa:alex-p/jbig2enc
sudo apt update
sudo apt install jbig2enc
For all other Linux, you must build a JBIG2 encoder from source: For all other Linux, you must build a JBIG2 encoder from source:
.. code-block:: bash .. code-block:: bash