Skip to content

Commit

Permalink
copy of i343
Browse files Browse the repository at this point in the history
Copy of PR to see if the pipeline will behave differently.

ref:
- #2187
  • Loading branch information
ShanaLMoore committed May 9, 2024
1 parent 8540860 commit 060e76a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ GIT

GIT
remote: https://github.com/scientist-softserv/iiif_print.git
revision: 122e86634f17c8f40d9ae4d59d2d7deca00f1694
revision: cee97520f95e90a9e75d4dbcf159db337676e3c6
branch: main
specs:
iiif_print (1.0.0)
Expand Down
11 changes: 11 additions & 0 deletions app/services/iiif_print/tenant_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<Symbol>] predicate methods (e.g. ending in "?") that reflect the types
# of files we want to consider for showing in the IIIF Viewer.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/iiif_print.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This migration comes from iiif_print (originally 20231110163052)
class AddModelDetailsToIiifPrintPendingRelationships < ActiveRecord::Migration[5.2]
def change
add_column :iiif_print_pending_relationships, :parent_model, :string
add_column :iiif_print_pending_relationships, :child_model, :string
add_column :iiif_print_pending_relationships, :file_id, :string
add_column :iiif_print_pending_relationships, :parent_model, :string unless column_exists?(:iif_print_pending_relationships, :parent_model)
add_column :iiif_print_pending_relationships, :child_model, :string unless column_exists?(:iif_print_pending_relationships, :child_model)
add_column :iiif_print_pending_relationships, :file_id, :string unless column_exists?(:iif_print_pending_relationships, :file_id)
end
end

0 comments on commit 060e76a

Please sign in to comment.