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
Try following links to calculate aspect ratio ..
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."
Good Luck ;)