Class: Riiif::Size::Imagemagick::WidthDecoder

Inherits:
Object
  • Object
show all
Defined in:
app/services/riiif/size/imagemagick/width_decoder.rb

Overview

The image or region should be scaled so that its width is exactly equal to the provided parameter, and the height will be a calculated value that maintains the aspect ratio of the extracted region

Instance Method Summary collapse

Constructor Details

#initialize(width) ⇒ WidthDecoder

Returns a new instance of WidthDecoder.



8
9
10
# File 'app/services/riiif/size/imagemagick/width_decoder.rb', line 8

def initialize(width)
  @width = width
end

Instance Method Details

#decodeString

Returns a resize directive for imagemagick to use.

Returns:

  • (String)

    a resize directive for imagemagick to use



13
14
15
# File 'app/services/riiif/size/imagemagick/width_decoder.rb', line 13

def decode
  @width.to_s
end