-
Notifications
You must be signed in to change notification settings - Fork 122
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
Include fcr:version in IIIF image URI #3165
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,17 +13,18 @@ def display_image | |
return nil unless ::FileSet.exists?(id) && solr_document.image? && current_ability.can?(:read, id) | ||
# @todo this is slow, find a better way (perhaps index iiif url): | ||
original_file = ::FileSet.find(id).original_file | ||
latest_file_id = original_file.has_versions? ? ActiveFedora::File.uri_to_id(original_file.versions.last.uri) : original_file.id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of has_versions? was meant as a safeguard in case a file did not have support for versioning, although I do not know if that is really an issue in any application. For now I'm working on the potential timestamp based solution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the knowledge. And thanks for getting this solution going so we could begin applying it to Sufia. Not sure if it helps to share, but we are experiencing some older version Riiif tiles still when a new file_set version derivative is not completed yet. What i plan to do is control the What I'm not 100% sure of yet is how I will control the versioning. I may just increment some solr field on the file_set that acts as the version. Any thoughts from the community are welcome, even those that correct my thinking. All of this is new to me and I may be a smidgeon off. Best, |
||
|
||
url = Hyrax.config.iiif_image_url_builder.call( | ||
original_file.id, | ||
latest_file_id, | ||
request.base_url, | ||
Hyrax.config.iiif_image_size_default | ||
) | ||
# @see https://github.com/samvera-labs/iiif_manifest | ||
IIIFManifest::DisplayImage.new(url, | ||
width: 640, | ||
height: 480, | ||
iiif_endpoint: iiif_endpoint(original_file.id)) | ||
iiif_endpoint: iiif_endpoint(latest_file_id)) | ||
end | ||
|
||
private | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dlpierce - I was just wondering - does this need to be encoded? So that Apache or the like doesn't receive a decoded path? I am learning a bit here and in my Suifa application, I had to apply your spec's
ActionDispatch::Journey::Router::Utils.escape_segment(uri)
above so that the image requests went through ok.