Sha256: d89737065fdd994cc0af55466275146e7bf7006c301c475596a3061016d986da

Contents?: true

Size: 489 Bytes

Versions: 2

Compression:

Stored size: 489 Bytes

Contents

module Riiif
  module Size
    # 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 BestFit < Resize
      def initialize(info, width, height)
        @image_info = info
        @width = width
        @height = height
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riiif-2.0.0.beta2 app/services/riiif/size/best_fit.rb
riiif-2.0.0.beta1 app/services/riiif/size/best_fit.rb