tMTboss
tMTboss

Reputation: 171

Getting specified width and height rmagick and paperclip

Seems like this should be an easy question but couldn't get it to work after using the documents at http://www.imagemagick.org/script/command-line-processing.php?ImageMagick=lj6pre8q2iautc3ch6nuph1fc2#geometry.

All I'm trying to get is get my image to have a set width and set height at 450px wide and 300px height along with maintaining some of its aspect ratio. Which style can accomplish this?

Upvotes: 0

Views: 144

Answers (1)

user2563346
user2563346

Reputation:

This should help

has_attached_file :image,
                :styles => {
                    :thumb => "125x100#",
                    :small => "450x300>",
                    :large => "600x600>"
                },
                :url => "/path/to/:id/:style/:basename.:extension",
                :path => ":rails_root/path/to/:id/:style/:basename.:extension"

Upvotes: 1

Related Questions