Super Spread Sheet S³

Or little computing tricks and hacks

Image manipulation commands in Carrierwave

In my Rails app, I am using the gems

gem 'mini_magick'
gem 'carrierwave'

for image manipulation of files entered by users. Even though the sample files are full of useful comments, I did not find a comprehensive list of the possible commands. I needed to create exact sizes respecting ratio. The internet searches failed me today! Perhaps I was in a rush…

I found this post, which is actually describing another gem for image manipulation, describing the following commands:

resize_to_limit(width, height)

resize an image down to fit the width and height, maintaining the image ratio.

resize_to_fit(width, height)

resize an image up or down to fit the width and height, maintaining the image ratio.

resize_to_fill(width, height)

crop and resize to fit the width and height.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: