Sha256: 4899366ac46dfeb1e306821df6b0b35c4269f0e8fd00b67ad355697ee4e0e95b

Contents?: true

Size: 501 Bytes

Versions: 14

Compression:

Stored size: 501 Bytes

Contents

module Riiif
  module Size
    module Imagemagick
      # 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.
      class BestFitDecoder
        def initialize(width, height)
          @width = width
          @height = height
        end

        # @return [String] a resize directive for imagemagick to use
        def decode
          "#{@width}x#{@height}"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
riiif-1.7.1 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.7.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.6.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.5.1 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.5.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.4.4 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.4.3 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.4.2 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.4.1 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.4.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.3.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.2.0 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.1.3 app/services/riiif/size/imagemagick/best_fit_decoder.rb
riiif-1.1.2 app/services/riiif/size/imagemagick/best_fit_decoder.rb