1

除了原始图像之外,我正在努力让 Paperclip 存储一个缩略图。原始图像始终保存文件,现在我正在尝试添加缩略图。

问题是,一旦我定义了样式缩略图,原来的就不再被保存了。我怎样才能让原件和拇指一起保存?

has_mongoid_attached_file :attachment,
  :storage => :s3,
  :s3_credentials => "s3.yml",
  :s3_protocol => 'https',
  :s3_permissions => :private,
  :use_timestamp => true,
  :default_style => :original,
  :default_url => '/images/:attachment/default_:style.png',
  :path => "/:rails_env/private/:basename.:extension",
  :styles => {
    :thumb => "100x100#" },
  :convert_options => {
    :thumb => "-quality 75 -strip" }
4

1 回答 1

-1

安装Imagemagic ( https://github.com/thoughtbot/paperclip) 然后你可以像这样使用将原始大小的照片调整为任意大小

<img src="#", size: '150x150'>
于 2013-10-04T03:59:49.340 回答