diff --git a/Dockerfile b/Dockerfile index 325d61452b..1993d99135 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,11 @@ RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-57.t && rm -rf ImageMagick* \ && rm -rf /var/cache/apk/* +# Install "best" training data for Tesseract +RUN echo "📚 Installing Tesseract Best (training data)!" && \ + cd /usr/share/tessdata/ && \ + wget https://github.com/tesseract-ocr/tessdata_best/blob/main/eng.traineddata?raw=true -O eng_best.traineddata + ARG VIPS_VERSION=8.11.3 RUN set -x -o pipefail \ diff --git a/app/services/iiif_print/tenant_config.rb b/app/services/iiif_print/tenant_config.rb index 14ef3642bc..a82bc77be8 100644 --- a/app/services/iiif_print/tenant_config.rb +++ b/app/services/iiif_print/tenant_config.rb @@ -100,6 +100,11 @@ module PdfSplitter mattr_accessor :iiif_print_splitter self.iiif_print_splitter = ::IiifPrint::SplitPdfs::PagesToJpgsSplitter + ## + def self.never_split_pdfs? + !TenantConfig.use_iiif_print? + end + ## # @api public def self.call(*args) @@ -147,6 +152,12 @@ def service # In Hyrax::WorkShowPresenter we're only looking at the underlying file_sets. But IiifPrint # needs to look at multiple places. module WorkShowPresenterDecorator + ## + # @return [Boolean] Identifies whether IiifPrint PDF splitting is active for this work's tenant + def split_pdfs? + TenantConfig.use_iiif_print? + end + ## # @return [Array] predicate methods (e.g. ending in "?") that reflect the types # of files we want to consider for showing in the IIIF Viewer. @@ -167,6 +178,7 @@ def iiif_media?(presenter: representative_presenter) # # OVERRIDE Hyrax::WorkShowPresenter; this override introduces behavior to handle over-rides. def iiif_viewer? +return false Hyrax.config.iiif_image_server? && representative_id.present? && representative_presenter.present? && diff --git a/config/initializers/iiif_print.rb b/config/initializers/iiif_print.rb index e83325c644..15c567a708 100644 --- a/config/initializers/iiif_print.rb +++ b/config/initializers/iiif_print.rb @@ -22,4 +22,5 @@ # config.sort_iiif_manifest_canvases_by = :date_published config.default_iiif_manifest_version = 3 config.persistence_adapter = IiifPrint::PersistenceLayer::ValkyrieAdapter + config.additional_tesseract_options = "-l eng_best" end