app/models/spotlight/featured_image.rb in blacklight-spotlight-2.2.1 vs app/models/spotlight/featured_image.rb in blacklight-spotlight-2.3.0
- old
+ new
@@ -13,10 +13,11 @@
after_create :set_tilesource_from_uploaded_resource
def iiif_url
return unless iiif_service_base.present?
+
[iiif_service_base, iiif_region || 'full', image_size.join(','), '0', 'default.jpg'].join('/')
end
# This is used to fetch images given the URL field in the CSV uploads
# If the image is local, this step will fail, which is okay since the only
@@ -47,10 +48,11 @@
private
def set_tilesource_from_uploaded_resource
return if iiif_tilesource
+
riiif = Riiif::Engine.routes.url_helpers
self.iiif_tilesource = riiif.info_path(id)
save
end
@@ -58,9 +60,10 @@
Spotlight::Engine.config.featured_image_thumb_size
end
def iiif_service_base
return unless iiif_tilesource
+
iiif_tilesource.sub('/info.json', '')
end
end
end