How can I reduce the quality of an uploading image using Paperclip?

后端 未结 4 1980
無奈伤痛
無奈伤痛 2021-01-18 08:26

I am running Ruby on Rails 3 and I would like to reduce the quality of an uploading image using the Paperclip plugin/gem. How can I do that?


A

4条回答
  •  被撕碎了的回忆
    2021-01-18 09:18

    Except -quality, the -strip option of ImageMagick can remove all profile and other fluff from the image which may reduce more size

    has_attached_file :photo,
      :styles => {
      :thumb => "100x100#" },
      :convert_options => {
      :thumb => "-quality 75 -strip" }
    

提交回复
热议问题