lib/djatoka/iiif_request.rb in djatoka-0.2.4 vs lib/djatoka/iiif_request.rb in djatoka-0.3.0
- old
+ new
@@ -37,11 +37,11 @@
# * Usage example
# resolver = Djatoka::Resolver.new('http://server.edu/adore-djatoka/resolver')
# id = 'someImageId1234'
#
# request = Djatoka::IiifRequest.new(resolver, id)
- # djatoka_region = request.region('full').size('full').rotation('0').quality('native').format('jpg').djatoka_region
+ # djatoka_region = request.region('full').size('full').rotation('0').quality('default').format('jpg').djatoka_region
class IiifRequest
ALL_PARAMS = Set.new(['region', 'size', 'rotation', 'quality', 'format'])
attr_accessor :iiif_params
@@ -103,11 +103,11 @@
missing = (ALL_PARAMS - current).to_a
msg = "Invalid IIIF request. The following params are missing: " << missing.join(',')
raise IiifException.new(msg)
end
- region = @resolver.region(@iiif_params[:id])
+ region = @resolver.region(@id)
if(@iiif_params[:region] =~ /^(\d+),(\d+),(\d+),(\d+)$/)
region.region("#{$2},#{$1},#{$4},#{$3}")
elsif(!(@iiif_params[:region] =~ /^full$/i))
raise IiifInvalidParam.new "region", @iiif_params[:region]
@@ -148,16 +148,16 @@
#default to jpg or let djatoka determine default
type = MIME::Types.type_for('jpg').first
end
region.format(type.to_s)
- unless(@iiif_params[:quality] =~ /^(native|color|grey|bitonal)$/i)
+ unless(@iiif_params[:quality] =~ /^(default|color|gray|bitonal)$/i)
raise IiifInvalidParam.new 'quality', @iiif_params[:quality]
end
region
end
end
-end
\ No newline at end of file
+end