Sha256: 8fb108b2c254b24118216b0aefb1c289e9c0a85e2786964975a24b91e1c88ddf
Contents?: true
Size: 663 Bytes
Versions: 53
Compression:
Stored size: 663 Bytes
Contents
require_relative 'base' module Udongo module ImageManipulation class ResizeToFit include Udongo::ImageManipulation::Base # Resize the image to fit within the specified dimensions while retaining # the original aspect ratio. The image may be shorter or narrower than # specified in the smaller dimension but will not be larger than the specified values. # def resize(path) img = MiniMagick::Image.open(@file) img.combine_options do |c| c.quality @options[:quality] if @options[:quality] c.resize "#{@width}x#{@height}" end img.write(path) end end end end
Version data entries
53 entries across 53 versions & 1 rubygems