【问题标题】:Rails 3.0.1 and Paperclip - Image not resizingRails 3.0.1 和 Paperclip - 图像未调整大小
【发布时间】:2010-11-29 18:19:13
【问题描述】:

我的模型上有以下代码:

has_attached_file :photo, :styles => { :small => "150x150#" }, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/photo/:id/:style/:filename", :s3_headers => { 'Cache-Control' => 'max-age=315576000', 'Expires' => 10.years.from_now.httpdate }

上传图片时,只保存原图,样式无效。没有生成小文件。

【问题讨论】:

  • 假设你已经安装了 rmagick?
  • 是的,ImageMagick 已安装,但可能没有正确配置?我可以从命令行使用它,而且我没有收到回形针的抱怨。

标签: ruby ruby-on-rails-3 imagemagick paperclip resize-image


【解决方案1】:

您只需要将 gem 更新到最新最好的版本

【讨论】:

    【解决方案2】:

    假设您的 S3 凭据没问题,也许您应该尝试为小文件设置文件类型。类似 :styles => { :small => "150x150#", :png }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-04
      • 2014-11-10
      • 1970-01-01
      • 1970-01-01
      • 2018-02-06
      • 2011-03-04
      • 2016-12-16
      相关资源
      最近更新 更多