回形针调整大小和裁剪

时间:2014-03-28 10:54:33

标签: ruby-on-rails ruby-on-rails-4 paperclip image-resizing

我正在使用Paperclip和Rails4。我有以下图片

enter image description here

现在我想调整大小和裁剪图像,但是它会被裁剪,图像的方向会像下面那样移位

enter image description here

:photo,
    :path => ":rails_root/public/system/:attachment/:id/:style/:filename",
    :url => "/system/:attachment/:id/:style/:filename",
    :styles => {
        :small => { :geometry => "100x100!" },
        :medium => { :geometry => "500x500!"}
}

1 个答案:

答案 0 :(得分:4)

结帐ImageMagic resize docs。您可能需要使用100x100#代替100x100!