Class: Riiif::Size::Imagemagick::PercentDecoder
- Inherits:
-
Object
- Object
- Riiif::Size::Imagemagick::PercentDecoder
- Defined in:
- app/services/riiif/size/imagemagick/percent_decoder.rb
Overview
The width and height of the returned image is scaled to n% of the width and height of the extracted region. The aspect ratio of the returned image is the same as that of the extracted region.
Instance Method Summary collapse
-
#decode ⇒ String
A resize directive for imagemagick to use.
-
#initialize(n) ⇒ PercentDecoder
constructor
A new instance of PercentDecoder.
Constructor Details
#initialize(n) ⇒ PercentDecoder
Returns a new instance of PercentDecoder.
8 9 10 |
# File 'app/services/riiif/size/imagemagick/percent_decoder.rb', line 8 def initialize(n) @n = n end |
Instance Method Details
#decode ⇒ String
Returns a resize directive for imagemagick to use.
13 14 15 |
# File 'app/services/riiif/size/imagemagick/percent_decoder.rb', line 13 def decode "#{@n}%" end |