Module: FastImage::Resize::ClassMethods

Defined in:
lib/fastimage/resize.rb

Instance Method Summary collapse

Instance Method Details

#resize(source, width, height, options = {}) ⇒ Object

Resizes an image, storing the result in a file given in file_out

Input can be a filename, a uri, or an IO object.

FastImage Resize can resize GIF, JPEG and PNG files.

Giving a zero value for width or height causes the image to scale proportionately.

Example

require 'fastimage_resize'

FastImage.resize("http://stephensykes.com/images/ss.com_x.gif", 100, 20, outfile: "my.gif")

Supported options

:jpeg_quality

A figure passed to libgd to determine quality of output jpeg (only useful if input is jpeg)

:outfile

Name of a file to store the output in, in this case a temp file is not used



60
61
62
# File 'lib/fastimage/resize.rb', line 60

def resize(source, width, height, options={})
  new(source, raise_on_failure: true).resize(width, height, options)
end