Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
3 Posts
crop images

Hi , Am calcualting aspectration to crop images .Finally calculated aspectration i got 4 inches extra for my actual aviable height of the image. So i want to crop the image top and bottom equally .I mean top 2 inches and bottom inches crop the height of the image.Can anybody suggest solution

Person
Forum Rating: 50
Sign In To Rate Post

Hi,

Try following links to calculate aspect ratio ..

http://andrew.hedges.name/experiments/aspect_ratio/

http://www.digitalrebellion.com/aspect_calc.htm

Or if you want maintain aspect ration with Rmagick then.. try this..

"If only the width is specified, the width assumes the value and the height is chosen to maintain the aspect ratio of the image. Similarly, if only the height is specified (e.g., "x256"), the width is chosen to maintain the aspect ratio. To specify a percentage width or height instead, append %. The image size is multiplied by the width and height percentages to obtain the final image dimensions. To increase the size of an image, use a value greater than 100 (e.g. 125%). To decrease an image's size, use a percentage less than 100."

Reference... http://www.imagemagick.org/RMagick/doc/imusage.html

Good Luck ;)

-Ganesh K

Person
Jruby, Ruby, Rails Programmer
Sign In To Rate Post

Hi

I want to calculate aspectratio and crop images into that dimention and am using rmagick to crop.

Can anybody help

Person
Forum Rating: 50
Sign In To Rate Post
3 Posts
Login to add your message