riiif 1.7.1 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +15 -41
- data/Gemfile +1 -37
- data/app/models/riiif/file.rb +19 -12
- data/app/models/riiif/image.rb +13 -12
- data/app/models/riiif/image_information.rb +4 -0
- data/app/models/riiif/transformation.rb +35 -0
- data/{lib → app/resolvers}/riiif/abstract_file_system_resolver.rb +0 -0
- data/{lib → app/resolvers}/riiif/akubra_system_file_resolver.rb +0 -0
- data/{lib → app/resolvers}/riiif/file_system_file_resolver.rb +0 -0
- data/{lib → app/resolvers}/riiif/http_file_resolver.rb +0 -0
- data/app/services/riiif/command_runner.rb +2 -0
- data/app/services/riiif/crop.rb +54 -0
- data/app/services/riiif/imagemagick_command_factory.rb +20 -19
- data/app/services/riiif/imagemagick_transformer.rb +8 -0
- data/app/services/riiif/kakadu_command_factory.rb +63 -0
- data/app/services/riiif/link_name_service.rb +8 -0
- data/{lib → app/services}/riiif/nil_authorization_service.rb +0 -0
- data/app/services/riiif/option_decoder.rb +11 -11
- data/app/services/riiif/region/absolute.rb +23 -0
- data/app/services/riiif/region/full.rb +23 -0
- data/app/services/riiif/region/percentage.rb +68 -0
- data/app/services/riiif/region/square.rb +45 -0
- data/app/services/riiif/resize.rb +45 -0
- data/app/services/riiif/size/absolute.rb +39 -0
- data/app/services/riiif/size/best_fit.rb +18 -0
- data/app/services/riiif/size/full.rb +17 -0
- data/app/services/riiif/size/height.rb +24 -0
- data/app/services/riiif/size/percent.rb +44 -0
- data/app/services/riiif/size/width.rb +24 -0
- data/app/transformers/riiif/abstract_transformer.rb +30 -0
- data/app/transformers/riiif/imagemagick_transformer.rb +8 -0
- data/app/transformers/riiif/kakadu_transformer.rb +39 -0
- data/lib/riiif.rb +4 -7
- data/lib/riiif/engine.rb +4 -3
- data/lib/riiif/version.rb +1 -1
- data/riiif.gemspec +1 -1
- data/spec/models/riiif/image_spec.rb +6 -3
- data/spec/models/riiif/transformation_spec.rb +42 -0
- data/spec/services/riiif/imagemagick_command_factory_spec.rb +6 -4
- data/spec/services/riiif/kakadu_command_factory_spec.rb +85 -0
- data/spec/services/riiif/region/absolute_spec.rb +17 -0
- data/spec/services/riiif/size/absolute_spec.rb +17 -0
- data/spec/services/riiif/size/height_spec.rb +13 -0
- data/spec/services/riiif/size/width_spec.rb +13 -0
- data/spec/transformers/riiif/kakadu_transformer_spec.rb +143 -0
- metadata +45 -22
- data/app/services/riiif/region/imagemagick/absolute_decoder.rb +0 -21
- data/app/services/riiif/region/imagemagick/full_decoder.rb +0 -14
- data/app/services/riiif/region/imagemagick/percentage_decoder.rb +0 -33
- data/app/services/riiif/region/imagemagick/square_decoder.rb +0 -25
- data/app/services/riiif/size/imagemagick/absolute_decoder.rb +0 -20
- data/app/services/riiif/size/imagemagick/best_fit_decoder.rb +0 -19
- data/app/services/riiif/size/imagemagick/full_decoder.rb +0 -14
- data/app/services/riiif/size/imagemagick/height_decoder.rb +0 -19
- data/app/services/riiif/size/imagemagick/percent_decoder.rb +0 -19
- data/app/services/riiif/size/imagemagick/width_decoder.rb +0 -19
@@ -1,19 +0,0 @@
|
|
1
|
-
module Riiif
|
2
|
-
module Size
|
3
|
-
module Imagemagick
|
4
|
-
# The width and height of the returned image is scaled to n% of the width and height
|
5
|
-
# of the extracted region. The aspect ratio of the returned image is the same as that
|
6
|
-
# of the extracted region.
|
7
|
-
class PercentDecoder
|
8
|
-
def initialize(n)
|
9
|
-
@n = n
|
10
|
-
end
|
11
|
-
|
12
|
-
# @return [String] a resize directive for imagemagick to use
|
13
|
-
def decode
|
14
|
-
"#{@n}%"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Riiif
|
2
|
-
module Size
|
3
|
-
module Imagemagick
|
4
|
-
# The image or region should be scaled so that its width is exactly equal
|
5
|
-
# to the provided parameter, and the height will be a calculated value that
|
6
|
-
# maintains the aspect ratio of the extracted region
|
7
|
-
class WidthDecoder
|
8
|
-
def initialize(width)
|
9
|
-
@width = width
|
10
|
-
end
|
11
|
-
|
12
|
-
# @return [String] a resize directive for imagemagick to use
|
13
|
-
def decode
|
14
|
-
@width.to_s
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|