Class: Riiif::Size::Imagemagick::BestFitDecoder
- Inherits:
-
Object
- Object
- Riiif::Size::Imagemagick::BestFitDecoder
- Defined in:
- app/services/riiif/size/imagemagick/best_fit_decoder.rb
Overview
The image content is scaled for the best fit such that the resulting width and height are less than or equal to the requested width and height.
Instance Method Summary collapse
-
#decode ⇒ String
A resize directive for imagemagick to use.
-
#initialize(width, height) ⇒ BestFitDecoder
constructor
A new instance of BestFitDecoder.
Constructor Details
#initialize(width, height) ⇒ BestFitDecoder
Returns a new instance of BestFitDecoder.
7 8 9 10 |
# File 'app/services/riiif/size/imagemagick/best_fit_decoder.rb', line 7 def initialize(width, height) @width = width @height = height end |
Instance Method Details
#decode ⇒ String
Returns a resize directive for imagemagick to use.
13 14 15 |
# File 'app/services/riiif/size/imagemagick/best_fit_decoder.rb', line 13 def decode "#{@width}x#{@height}" end |