我想用回形针裁剪上传的图片,从原始图片的中心取方形拇指.我在文档中找到了一种方法,它似乎正是我想要的:
transformation_to(dst, crop = false)
问题是我不知道在哪里使用这种方法.在这里简单地传递一些东西作为参数会很好:
has_attached_file :picture, :styles => { :medium => "600x600>", :thumb => "something here" }
我想用回形针裁剪上传的图片,从原始图片的中心取方形拇指.我在文档中找到了一种方法,它似乎正是我想要的:
transformation_to(dst, crop = false)
问题是我不知道在哪里使用这种方法.在这里简单地传递一些东西作为参数会很好:
has_attached_file :picture, :styles => { :medium => "600x600>", :thumb => "something here" }
You only need to use # instead of > as a parameter:
has_attached_file :picture, :styles => { :thumb => "200x200#" }