0.0
No commit activity in last 3 years
No release in over 3 years
An easy way to resize images using ImageMagick with Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.0

Runtime

>= 2.13.2
 Project Readme

ImageResizing

An easy way to resize images using ImageMagick with Ruby.

Installation

It's based on ImagaMagic & it has to be installed in your OS. What i did to install it on OSX is to type...

brew install imagemagick

Once the ImagaMagick is installed, install this gem:

gem 'image_resizing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install image_resizing

Usage

#Start by requiring...
require "image_resizing"

#Create an instance of the class...
ir = ImageResizing::ImageResizer.new

#Now lets resize an image by setting the width & height of it
#The first argument is the new width to set
#Second is the height
#The third is the path of the image file to resize
#And the fourth is The destination path of the newly resized page

ir.resize_by_width_and_height(100, 70, input.jpg, resized_output.jpg)

#And lets resize the other image by the ratio in percent
#The first argument is the ratio in %.
#In the example below, whe chose to minimize the size with 50 % of the original size
#The first parameter is the ratio in %
#The second is the path of the image file to resize
#The third is The destination path of the newly resized page

ir.resize_by_ratio(50, input2.jpg, resized_output2.jpg)