Rename container scripts to document-to-pixels and pixels-to-pdf, and add tesseract dependency

This commit is contained in:
Micah Lee 2020-01-07 09:32:51 -08:00
parent 195386d526
commit db23ced6c5
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 5 additions and 5 deletions

View file

@ -91,7 +91,7 @@ class ConvertToPixels(TaskBase):
"-v", "-v",
f"{self.common.pixel_dir.name}:/dangerzone", f"{self.common.pixel_dir.name}:/dangerzone",
"dangerzone", "dangerzone",
"convert_to_pixels", "document-to-pixels",
] ]
output = self.execute_podman(args) output = self.execute_podman(args)
@ -171,7 +171,7 @@ class ConvertToPDF(TaskBase):
"-v", "-v",
f"{self.common.safe_dir.name}:/safezone", f"{self.common.safe_dir.name}:/safezone",
"dangerzone", "dangerzone",
"convert_to_pdf", "pixels-to-pdf",
] ]
self.execute_podman(args) self.execute_podman(args)
self.task_finished.emit() self.task_finished.emit()

View file

@ -1,10 +1,10 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y file poppler-utils imagemagick ghostscript apt-get install -y file poppler-utils imagemagick ghostscript tesseract-ocr tesseract-ocr-all
# Fix imagemagick policy to allow writing PDFs # Fix imagemagick policy to allow writing PDFs
RUN sed -i '/rights="none" pattern="PDF"/c\<policy domain="coder" rights="read|write" pattern="PDF" />' /etc/ImageMagick-6/policy.xml RUN sed -i '/rights="none" pattern="PDF"/c\<policy domain="coder" rights="read|write" pattern="PDF" />' /etc/ImageMagick-6/policy.xml
COPY convert_to_pixels /usr/local/bin/convert_to_pixels COPY document-to-pixels /usr/local/bin/document-to-pixels
COPY convert_to_pdf /usr/local/bin/convert_to_pdf COPY pixels-to-pdf /usr/local/bin/pixels-to-pdf