2014-08-28 102 views
-1

我需要的任何解决方案,减少图像尺寸Rails的缩小图像尺寸上有些%

我使用回形针

has_attached_file :image, :styles => { :small =>{ :geometry =>"200 x 123>"}} 

,比如我有原始图像1 MB和一些魔术后,我要像300 KB ,然后上载在AWS上

回答

1

可以使用convert_options

has_attached_file :image, 
        :convert_options => { :thumb => '-quality 50' } 

,或者你可以试试这个

has_attached_file :image => { :quality => :better } 

参见:Paperclip doc

+0

has_attached_file:image,:styles => {:thumb =>“300x123>”},:convert_options => {:thumb =>' - 质量50'}我做了所有的事情 – sts 2014-08-28 11:59:40