Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy of i343 #2209

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading