Sha256: 3d3af1e56944503f21e2fa3800bf78e43d9d498cd5c1bb649dcbe099d8f270a9

Contents?: true

Size: 1.03 KB

Versions: 54

Compression:

Stored size: 1.03 KB

Contents

Riiif::Image.file_resolver = Riiif::HTTPFileResolver.new
Riiif::Image.info_service = lambda do |id, _file|
  # id will look like a path to a pcdm:file
  # (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
  # but we just want the id for the FileSet it's attached to.

  # Capture everything before the first slash
  fs_id = id.sub(/\A([^\/]*)\/.*/, '\1')
  resp = ActiveFedora::SolrService.get("id:#{fs_id}")
  doc = resp['response']['docs'].first
  raise "Unable to find solr document with id:#{fs_id}" unless doc
  { height: doc['height_is'], width: doc['width_is'] }
end

Riiif::Image.file_resolver.id_to_uri = lambda do |id|
  ActiveFedora::Base.id_to_uri(CGI.unescape(id)).tap do |url|
    Rails.logger.info "Riiif resolved #{id} to #{url}"
  end
end

Riiif::Image.authorization_service = Hyrax::IIIFAuthorizationService

Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')

Riiif::Engine.config.cache_duration_in_days = 365

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
hyrax-2.9.6 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.9.5 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.9.4 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.9.3 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.9.2 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.9.1 lib/generators/hyrax/templates/config/initializers/riiif.rb
zizia-6.0.1 spec/dummy/config/initializers/riiif.rb
hyrax-2.9.0 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.8.0 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.7.2 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.7.1 lib/generators/hyrax/templates/config/initializers/riiif.rb
hyrax-2.7.0 lib/generators/hyrax/templates/config/initializers/riiif.rb
zizia-6.0.0 spec/dummy/config/initializers/riiif.rb
zizia-5.5.0 spec/dummy/config/initializers/riiif.rb
zizia-5.4.0 spec/dummy/config/initializers/riiif.rb
zizia-5.3.0 spec/dummy/config/initializers/riiif.rb
zizia-5.2.0 spec/dummy/config/initializers/riiif.rb
zizia-5.1.0 spec/dummy/config/initializers/riiif.rb
hyrax-2.6.0 lib/generators/hyrax/templates/config/initializers/riiif.rb
zizia-5.0.1 spec/dummy/config/initializers/riiif.rb