Sha256: 7011358ad03dfa7c60a302b6f77ce19877dc1290fcfaa060c7c4502eaa7ef893
Contents?: true
Size: 577 Bytes
Versions: 12
Compression:
Stored size: 577 Bytes
Contents
module IIIF::Image module Size # 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 class Width # @param [Integer] width def initialize(width) @width = width end attr_reader :width # @param ratio [Rational] the aspect ratio def height_for_aspect_ratio(ratio) (width / ratio).round end def to_s "#{width}," end end end end
Version data entries
12 entries across 12 versions & 2 rubygems